diff --git a/.gitattributes b/.gitattributes index 364cb25308ecc215a766f00f488c8e2a2dced854..b2ed3c23c07f545952d3ff3783f6e58077e063d7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -202,3 +202,19 @@ mecademic_meca500/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text openarm_openarm_bimanual/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text openarm_openarm_unimanual/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text rethinkrobotics_sawyer_sawyer_instanceable/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +robotstudio_sysid_so101_new_calib/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +robotstudio_so100/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +robotstudio_so100/payloads/so101-camera_mount/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +robotstudio_so101_new_calib/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +techman_tm12/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_base.usd filter=lfs diff=lfs merge=lfs -text +ufactory_lite6/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +ufactory_uf850/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_base.usd filter=lfs diff=lfs merge=lfs -text +ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_base.usd filter=lfs diff=lfs merge=lfs -text +ufactory_xarm6/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_base.usd filter=lfs diff=lfs merge=lfs -text +ufactory_xarm7/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +unitree_z1/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text diff --git a/robotstudio_so100/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/robotstudio_so100/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..190f7dcee41b762703f38b7a600bb1df54ca4904 --- /dev/null +++ b/robotstudio_so100/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:30", + "assets": [ + { + "asset": "so100.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/robotstudio_so100/.metadata/com.nvidia.simready.packaging.bom.json b/robotstudio_so100/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..b86e6ee009f17835fc91a8ef3527bb0c1a8d885f --- /dev/null +++ b/robotstudio_so100/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,303 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.so100.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "7b7e1388a7a4d9ae829211f2b5f4cde000e24372061af205273caee2ea86f33b", + "sha256": "01db9d7709cec317beade9098a29d7f35265e714e86d4811585c5e8f43ad3315" + } + }, + { + "relative_path": ".thumbs/256x256/so100.usda.png", + "size": 55541, + "hash": { + "sha256-flat-1mb": "b72401d4bb1c819feb62765ad315c07b8c6595d7e8cd038b7954824f63290305", + "sha256": "9dff12ddd69565b39027da7eb6965be27c5b893dc227c67c390b4752b59c9a72" + } + }, + { + "relative_path": ".thumbs/so100.thumb.usd", + "size": 6122, + "hash": { + "sha256-flat-1mb": "61b72cdabff87d82fa51feb1408b794131587ec41319117eb68c3c8221c1c14b", + "sha256": "7b916442fcdd714de548f8cc9216d4f100ea5d58995162341ae31bfeaa8c24b8" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 3376, + "hash": { + "sha256-flat-1mb": "e06a9693297a84ae627b48a79d102638ba3c5b342181ab0f8cf9f1cb87fae9c3", + "sha256": "fc435a6e8575dff5341efa406da9024149e475100337dc44201d30a29debab90" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 135, + "hash": { + "sha256-flat-1mb": "487a1338d4c6ea56baf21e2d4a70af7bcc0381b319b73bcc947c2229d6685122", + "sha256": "d837c944098cc6d3bb69f2dac8ef1169f604bf1ea66887a000a334e1cee00cab" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12202, + "hash": { + "sha256-flat-1mb": "6030e95b60ad56e361d6738c38fb9bad34cc0b57658c5309a0c65b9fab36cb30", + "sha256": "9cf253ac61d56671fdf42f8979b0ba6c13dac92092502b226592eca95cffa45e" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1504, + "hash": { + "sha256-flat-1mb": "fe31c6982e0ae9fa73d59933683ba882c013abc1ce252d88d29ee7999d620da0", + "sha256": "94ac5099eebdcde2a475d56abaccf9c6d58b46c19cc8686acd041804f450c168" + } + }, + { + "relative_path": "payloads/Robot/none.usda", + "size": 135, + "hash": { + "sha256-flat-1mb": "487a1338d4c6ea56baf21e2d4a70af7bcc0381b319b73bcc947c2229d6685122", + "sha256": "d837c944098cc6d3bb69f2dac8ef1169f604bf1ea66887a000a334e1cee00cab" + } + }, + { + "relative_path": "payloads/Robot/robot.usda", + "size": 4981, + "hash": { + "sha256-flat-1mb": "d897426d073924e37760ec41b044680dbe841fd4d12cdb27876e4efdcabd638f", + "sha256": "cc17631d3e83a72f60fb0cbc9bfcc94734073b33c8a79ef27e80390e35ee0d8d" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 135, + "hash": { + "sha256-flat-1mb": "487a1338d4c6ea56baf21e2d4a70af7bcc0381b319b73bcc947c2229d6685122", + "sha256": "d837c944098cc6d3bb69f2dac8ef1169f604bf1ea66887a000a334e1cee00cab" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 141, + "hash": { + "sha256-flat-1mb": "810d6c041d36ba45b70f897e191ec96f4e17858c4bde199e664c9719f90c2280", + "sha256": "18f72b72505981cc9371459a95bd0ec7ffc352f6e3c503db84c58058db6bcafa" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 14781, + "hash": { + "sha256-flat-1mb": "84df7710d5b372a93d91666277e7235eb507c242e38d107ba05550460e0b6f6c", + "sha256": "19759b64f5b5786f4e1320a09afd90dfe7b21e3371f71e7b34e23b53b7ad46e8" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 4374155, + "hash": { + "sha256-flat-1mb": "5af3fc9103318655d2bc71b2a43a277c3e9a4840f2c0a07b2782aa80ed8e7119", + "sha256": "c9f0594574978d9dbd0e2006d86e770929083f36ab72b821abd6f62275419437", + "sha256-first1m": "972f0f53f48a83933e1cbd0187a31e2c4b0afbb997c8b6db45bdaf53113f9f07" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 29660, + "hash": { + "sha256-flat-1mb": "c9ae166d69591ac698f3e4d05c4517ac2abd2e9b4559d8232a463b5a3be68fce", + "sha256": "2e514a42472c10321c7f0e5ec7e447105bf5dfc28e1ee64cf968d8df45e5403a" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 10384, + "hash": { + "sha256-flat-1mb": "28ac02a943546da96e9d2d44b38e28faeec0c0fee43503dd5a721b8c38784ee5", + "sha256": "5dbef810e6524108967ffd885a456035c2b2dfccf39cae81b6484183984037bb" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 5333, + "hash": { + "sha256-flat-1mb": "4bb432bbd96ea6365940977ca7c1f8dfa6d16326688d31ded0fcdda35d442db5", + "sha256": "b8aa162cf63a84107fc742e398a88b77561bb74b03b209ede82e01c2a42b029d" + } + }, + { + "relative_path": "payloads/so101-camera_mount/SO-101_camera_mount.usda", + "size": 494, + "hash": { + "sha256-flat-1mb": "17ca4bfb9d35953fb7527a148b547065b782f80d75157265aa6c10bdb53f11f4", + "sha256": "1e3b7c7e89f6c49bbdbd4aa56a1fad747bd520b8d83a5d8c56d0f92cac576cb9" + } + }, + { + "relative_path": "payloads/so101-camera_mount/Textures/Aluminum_Anodized_BaseColor.png", + "size": 16903, + "hash": { + "sha256-flat-1mb": "b57814a5f40cefc160b110a48b72ab3e5eac0b8a002752dc746c6a6854cd9168", + "sha256": "d1d042502d7d94bca13cee10c63ab5b3801fb0a46e26d79169e13f5b9c7b5a31" + } + }, + { + "relative_path": "payloads/so101-camera_mount/Textures/Aluminum_Anodized_Black.mdl", + "size": 1503, + "hash": { + "sha256-flat-1mb": "c7a302629cc08eeda925a7b3c348054606697bf083556d4b911f11c146d2bd06", + "sha256": "9060004bbbb23c2c154676d5dd573a8dff42101347bdd664def8082c2d79ad1a" + } + }, + { + "relative_path": "payloads/so101-camera_mount/Textures/Aluminum_Anodized_Normal.png", + "size": 3321558, + "hash": { + "sha256-flat-1mb": "c400dda9a6d71499ee6df80ac03930fa70f9aedab88eeb44ec2ea0b250e266bc", + "sha256": "6dc1cb1b23a9abd766188a85ccbad1a2639d0a9a334f284e359c6c5d4438608e", + "sha256-first1m": "24164fb7ae9a7954e3a6e5034c7f316f9967e4698a6d39ea4a04f83175de647c" + } + }, + { + "relative_path": "payloads/so101-camera_mount/Textures/Aluminum_Anodized_ORM.png", + "size": 637843, + "hash": { + "sha256-flat-1mb": "34167b11c8131485c2aafd4bb00fa88ddb163d82fb45e2c017aa39a4dc594fdd", + "sha256": "768f2dbb4f702a9624b912b431efd1a6a8e0ff3e93744cf54f3866ef8f7986e9" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/base.usda", + "size": 14644, + "hash": { + "sha256-flat-1mb": "aad9524b7bf36f7f90b760713542033dbf6d47cfdd38932ea4540127af3ca7f3", + "sha256": "10950b505bb4a1b4c573d3b5cb126d13f99f257f4019bd326ee6fe58d09f3932" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/geometries.usd", + "size": 222444, + "hash": { + "sha256-flat-1mb": "69216b4b491114e6a827dd990c858afef424ea1a23000f198c612723fdd7d9e6", + "sha256": "8ec6117fce2e9b9aee4139070b7f436666a24ef96fd806f92e72e1902ab36149" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/instances.usda", + "size": 39266, + "hash": { + "sha256-flat-1mb": "066a0ae46b98d138b3b196751173a526a960a71e1f291cb35ece2d4a5cdd1ed9", + "sha256": "987fd450ed1e43274570f8cb9c6a1c2b09318c96526ffc1585bd921f7db7fa48" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/materials.usda", + "size": 17950, + "hash": { + "sha256-flat-1mb": "cfd47398d8a7e610a10a1e9578d41eca9f927b7d8a79496f91350d831d5901bf", + "sha256": "8a5bc68bc8015ff6c272da04c1ee4f3d8f9bfb64b9df9b19f79ae231b336bc70" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8690, + "hash": { + "sha256-flat-1mb": "b0b1d0e75351a487a37cf565a47827891064c51a68741a9a151b4db78947fae7", + "sha256": "b819331b21d0a9acc6d1aaabb2234dfb8f3ee223ea64a6b6fa111e1fb14bf636" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 5431, + "hash": { + "sha256-flat-1mb": "9155ab272b31041efb1250d4e4c4738638120a9a4a5a569318a80965f405a19d", + "sha256": "cb5b6c5762271ced9fb60ef745a2fd0561ce9b97f4e3e0667ba88326ab45176c" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 4234, + "hash": { + "sha256-flat-1mb": "13357497084512ecf515a963a5880efb44a4c0ebd496a92cdadcf65d61328e07", + "sha256": "bd2f03eb3f476ce1910c9ab507d05efb3edf5778f0a34f2a2db0f394bb0a5847" + } + }, + { + "relative_path": "so100.usda", + "size": 19661, + "hash": { + "sha256-flat-1mb": "bb198d4651a1f3c110ef0140ad1323a2a74d92caa5faf0183c69632f592fa17d", + "sha256": "de16933c4723ee8abbdb1fa1b0df2824c0467e201adf89b5ebf29a90957b6aad" + } + } + ] +} \ No newline at end of file diff --git a/robotstudio_so100/.metadata/com.nvidia.simready.root_usds.json b/robotstudio_so100/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..27b7ab1769d3a78a1eaf9ca1703262050fd37228 --- /dev/null +++ b/robotstudio_so100/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "so100.usda" + ] +} diff --git a/robotstudio_so100/.metadata/license.txt b/robotstudio_so100/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/robotstudio_so100/.metadata/license.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/robotstudio_so100/.simready/validation.json b/robotstudio_so100/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/robotstudio_so100/.simready/validation.json @@ -0,0 +1,223 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/robotstudio_so100/.thumbs/256x256/.so100.usda.last_generated b/robotstudio_so100/.thumbs/256x256/.so100.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..9090005bd6f31302b73f31bab688f318050f3bbe --- /dev/null +++ b/robotstudio_so100/.thumbs/256x256/.so100.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:40:50 \ No newline at end of file diff --git a/robotstudio_so100/.thumbs/256x256/so100.usda.png b/robotstudio_so100/.thumbs/256x256/so100.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..e3996a8947aec638a02e098b2b80e783920a228f --- /dev/null +++ b/robotstudio_so100/.thumbs/256x256/so100.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dff12ddd69565b39027da7eb6965be27c5b893dc227c67c390b4752b59c9a72 +size 55541 diff --git a/robotstudio_so100/.thumbs/so100.thumb.usd b/robotstudio_so100/.thumbs/so100.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..d539b99b06f577379ca08bd58f30f6e1e67d6b94 Binary files /dev/null and b/robotstudio_so100/.thumbs/so100.thumb.usd differ diff --git a/robotstudio_so100/com.nvidia.simready.packaging.json b/robotstudio_so100/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..841c27824d48ec2f82098af85cc3c5a35bba2caf --- /dev/null +++ b/robotstudio_so100/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "robotstudio_so100.1.0.0", + "license": "Apache-2.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "d122412a98635daeabb631b59c99ff6552a299fdcca93319c47a30b40103d312" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "80fd5cb2a7c005f4681c884fdfae85e23128218403f0300c5bc816d81f1125bd" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "9465a212294fe66ac0aaef865a6b785344192ba071d55375c90f1627d906607d" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + } + } + ], + "content_hash": { + "sha256": "3f195f824f65af6431ac7de11e686138290d039587ed8b1f832cfea2692e0541" + }, + "package_hash": { + "sha256": "8b8809cc9606fa7cd7545d6add2617d11491ac3c234b59e8396961f5eab3dc00" + } +} diff --git a/robotstudio_so100/materials/mdl/LICENSE.md b/robotstudio_so100/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/robotstudio_so100/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/robotstudio_so100/materials/mdl/OmniPBR.mdl b/robotstudio_so100/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/robotstudio_so100/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_so100/materials/mdl/OmniPBRBase.mdl b/robotstudio_so100/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/robotstudio_so100/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/robotstudio_so100/materials/mdl/OmniPBR_ClearCoat.mdl b/robotstudio_so100/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/robotstudio_so100/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_so100/materials/mdl/aux_definitions.mdl b/robotstudio_so100/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/robotstudio_so100/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/robotstudio_so100/materials/mdl/core_definitions.mdl b/robotstudio_so100/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/robotstudio_so100/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/robotstudio_so100/materials/mdl/support_definitions.mdl b/robotstudio_so100/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/robotstudio_so100/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/robotstudio_so100/payloads/Physics/mujoco.usda b/robotstudio_so100/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..1d212d325146315f4ab64e74d2f9852a26e724d9 --- /dev/null +++ b/robotstudio_so100/payloads/Physics/mujoco.usda @@ -0,0 +1,216 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "so_arm100" +{ + over "base" + { + over "visuals" + { + over "Base" + { + } + + over "Base_Motor" + { + } + } + + over "collisions" + { + over "Base" + { + } + } + } + + over "shoulder" + { + over "visuals" + { + over "Rotation_Pitch" + { + } + + over "Rotation_Pitch_Motor" + { + } + } + + over "collisions" + { + over "Rotation_Pitch" + { + } + } + } + + over "joints" + { + over "shoulder_pan" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "shoulder_lift" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "elbow_flex" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "wrist_flex" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "wrist_roll" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "gripper" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "upper_arm" + { + over "visuals" + { + over "Upper_Arm" + { + } + + over "Upper_Arm_Motor" + { + } + } + + over "collisions" + { + over "Upper_Arm" + { + } + } + } + + over "lower_arm" + { + over "visuals" + { + over "Lower_Arm" + { + } + + over "Lower_Arm_Motor" + { + } + } + + over "collisions" + { + over "Lower_Arm" + { + } + } + } + + over "wrist" + { + over "visuals" + { + over "Wrist_Pitch_Roll" + { + } + + over "Wrist_Pitch_Roll_Motor" + { + } + } + + over "collisions" + { + over "Wrist_Pitch_Roll" + { + } + } + } + + over "gripper" + { + over "visuals" + { + over "Fixed_Jaw" + { + } + + over "Fixed_Jaw_Motor" + { + } + } + + over "collisions" + { + over "Fixed_Jaw" + { + } + + over "Fixed_Jaw_Motor" + { + } + } + } + + over "jaw" + { + over "visuals" + { + over "Moving_Jaw" + { + } + } + + over "collisions" + { + over "Moving_Jaw" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + over "material_a_d_printed" + { + } + + over "material_sts3215" + { + } + } + + over "VisualMaterials" + { + } +} + diff --git a/robotstudio_so100/payloads/Physics/none.usda b/robotstudio_so100/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..a9ddb9331e53135205ec16e2b536c8f292cfff0e --- /dev/null +++ b/robotstudio_so100/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so_arm100" +{ +} + diff --git a/robotstudio_so100/payloads/Physics/physics.usda b/robotstudio_so100/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..1d01037399de6aea3d94e3878f2f2f8282941add --- /dev/null +++ b/robotstudio_so100/payloads/Physics/physics.usda @@ -0,0 +1,342 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so_arm100" +{ + over "base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.01, 0.01, 0.01) + float physics:mass = 1 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Base" ( + instanceable = false + ) + { + over "mesh" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "shoulder" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0000907886, 0.0590972, 0.031089) + float3 physics:diagonalInertia = (0.0000594278, 0.0000589975, 0.0000313712) + float physics:mass = 0.119226 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Rotation_Pitch" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "joints" + { + def PhysicsRevoluteJoint "shoulder_pan" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.002465164 + float drive:angular:physics:maxForce = 35 + float drive:angular:physics:stiffness = 6.16291 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Y" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.009860656 + point3f physics:localPos0 = (0, -0.0452, 0.0165) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.707109, 0.70710456, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -114.59155 + float physics:upperLimit = 114.59155 + } + + def PhysicsRevoluteJoint "shoulder_lift" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0023052262 + float drive:angular:physics:maxForce = 35 + float drive:angular:physics:stiffness = 5.7630653 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.009220905 + point3f physics:localPos0 = (0, 0.1025, 0.0306) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.62161, -0.7833269, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = 0 + float physics:upperLimit = 200.53522 + } + + def PhysicsRevoluteJoint "elbow_flex" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0006170539 + float drive:angular:physics:maxForce = 35 + float drive:angular:physics:stiffness = 1.5426347 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0024682155 + point3f physics:localPos0 = (0, 0.11257, 0.028) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.707109, 0.70710456, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -179.99927 + float physics:upperLimit = 0 + } + + def PhysicsRevoluteJoint "wrist_flex" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.002330651 + float drive:angular:physics:maxForce = 35 + float drive:angular:physics:stiffness = 5.8266273 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.009322604 + point3f physics:localPos0 = (0, 0.0052, 0.1349) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.87758255, -0.47942555, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -143.23944 + float physics:upperLimit = 68.75494 + } + + def PhysicsRevoluteJoint "wrist_roll" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0003617956 + float drive:angular:physics:maxForce = 35 + float drive:angular:physics:stiffness = 0.90448904 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Y" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0014471824 + point3f physics:localPos0 = (0, -0.0601, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.707109, 0, 0.70710456, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -179.99927 + float physics:upperLimit = 179.99927 + } + + def PhysicsRevoluteJoint "gripper" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.000026491503 + float drive:angular:physics:maxForce = 35 + float drive:angular:physics:stiffness = 0.066228755 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00010596601 + point3f physics:localPos0 = (-0.0202, -0.0244, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.000006274381, 0, 1, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -11.459155 + float physics:upperLimit = 114.59155 + } + } + + over "upper_arm" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0000172052, 0.0701802, 0.00310545) + float3 physics:diagonalInertia = (0.000213312, 0.000167164, 0.0000701522) + float physics:mass = 0.162409 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Upper_Arm" ( + instanceable = false + ) + { + over "mesh_4" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "lower_arm" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00339604, 0.00137796, 0.0768007) + float3 physics:diagonalInertia = (0.000138803, 0.000107748, 0.0000484242) + float physics:mass = 0.147968 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Lower_Arm" ( + instanceable = false + ) + { + over "mesh_6" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "wrist" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00852653, -0.0352279, -0.0000234622) + float3 physics:diagonalInertia = (0.0000345403, 0.0000239041, 0.0000194704) + float physics:mass = 0.0661321 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Wrist_Pitch_Roll" ( + instanceable = false + ) + { + over "mesh_8" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "gripper" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00552377, -0.0280167, 0.000483583) + float3 physics:diagonalInertia = (0.0000503136, 0.0000464098, 0.0000272961) + float physics:mass = 0.0929859 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Fixed_Jaw" ( + instanceable = false + ) + { + over "mesh_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Fixed_Jaw_Motor" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + } + } + + over "jaw" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00161745, -0.0303473, 0.000449646) + float3 physics:diagonalInertia = (0.0000111265, 0.00000899651, 0.00000299548) + float physics:mass = 0.0202444 + quatf physics:principalAxes = (1, 0, 0, 0) + + over "collisions" + { + over "Moving_Jaw" ( + instanceable = false + ) + { + over "mesh_12" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/robotstudio_so100/payloads/Physics/physx.usda b/robotstudio_so100/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..312658d2fe8263be08fda65d1450b08899bc4ebf --- /dev/null +++ b/robotstudio_so100/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "so_arm100" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "elbow_flex" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "wrist_flex" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "wrist_roll" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "gripper" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 1 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/robotstudio_so100/payloads/Robot/none.usda b/robotstudio_so100/payloads/Robot/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..a9ddb9331e53135205ec16e2b536c8f292cfff0e --- /dev/null +++ b/robotstudio_so100/payloads/Robot/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so_arm100" +{ +} + diff --git a/robotstudio_so100/payloads/Robot/robot.usda b/robotstudio_so100/payloads/Robot/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..4ed23d8e9e2a1903e9c3deaad18e62ee0ed9f9a4 --- /dev/null +++ b/robotstudio_so100/payloads/Robot/robot.usda @@ -0,0 +1,182 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so_arm100" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] + + over "base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "shoulder" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "shoulder_lift" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "elbow_flex" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_flex" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_roll" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "gripper" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + } + + over "upper_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "lower_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "wrist" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "gripper" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "jaw" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } +} + diff --git a/robotstudio_so100/payloads/Sensor/none.usda b/robotstudio_so100/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..a9ddb9331e53135205ec16e2b536c8f292cfff0e --- /dev/null +++ b/robotstudio_so100/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so_arm100" +{ +} + diff --git a/robotstudio_so100/payloads/Sensor/sensors.usda b/robotstudio_so100/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..9e03291aeff9f0578c79b68bb429a97eb7d94868 --- /dev/null +++ b/robotstudio_so100/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so_arm100" +{ +} + diff --git a/robotstudio_so100/payloads/base.usda b/robotstudio_so100/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..197d59e75482e8012811861c82df52738b9e686f --- /dev/null +++ b/robotstudio_so100/payloads/base.usda @@ -0,0 +1,444 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "so_arm100" +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "base" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Base" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Base_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "shoulder" + { + quatd xformOp:orient = (0.7071089744567871, 0.7071045637130737, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.04520000144839287, 0.016499999910593033) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Rotation_Pitch" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Rotation_Pitch_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Rotation_Pitch" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "joints" + { + } + + def Xform "upper_arm" + { + quatd xformOp:orient = (0.9934400320053101, -0.11435425281524658, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.0757993683218956, 0.11900018155574799) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Upper_Arm" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Upper_Arm_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Upper_Arm" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "lower_arm" + { + quatd xformOp:orient = (0.7833307981491089, 0.6216050386428833, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.04018832743167877, 0.12069104611873627) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Lower_Arm" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Lower_Arm_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Lower_Arm" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "wrist" + { + quatd xformOp:orient = (0.9854507446289062, 0.16996094584465027, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.09000180661678314, 0.1564062535762787) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Wrist_Pitch_Roll" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Wrist_Pitch_Roll_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Wrist_Pitch_Roll" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "gripper" + { + quatd xformOp:orient = (0.6968210935592651, 0.12018091231584549, 0.6968167424201965, 0.1201801598072052) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.14662960171699524, 0.13627417385578156) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Fixed_Jaw" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Fixed_Jaw_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Fixed_Jaw" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + + def Xform "Fixed_Jaw_Motor" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + } + + def Xform "jaw" + { + quatd xformOp:orient = (-0.6968123912811279, -0.12017940729856491, 0.6968254446983337, 0.12018166482448578) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-1.2526288628578186e-7, -0.17638644576072693, 0.1471337229013443) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "Moving_Jaw" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Moving_Jaw" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + } + + def Scope "Looks" + { + def Material "material_a_d_printed" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/robotstudio_so100/payloads/geometries.usd b/robotstudio_so100/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..5409b69a297e41a8c5bd820315d9787a2dd31ad4 --- /dev/null +++ b/robotstudio_so100/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9f0594574978d9dbd0e2006d86e770929083f36ab72b821abd6f62275419437 +size 4374155 diff --git a/robotstudio_so100/payloads/instances.usda b/robotstudio_so100/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..0c9edf60ff5b7a6fb0adbef5376e9ad5b6a74ff8 --- /dev/null +++ b/robotstudio_so100/payloads/instances.usda @@ -0,0 +1,880 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + bool physics:collisionEnabled = 1 + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + bool physics:collisionEnabled = 1 + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + bool physics:collisionEnabled = 1 + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/robotstudio_so100/payloads/materials.usda b/robotstudio_so100/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..e2bbb90de8501c9cee196c1b814023026a915d3c --- /dev/null +++ b/robotstudio_so100/payloads/materials.usda @@ -0,0 +1,289 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "DefaultMaterial" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_a_d_printed" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 0.82, 0.12) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_sts3215" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.1, 0.1, 0.1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/robotstudio_so100/payloads/robot.usda b/robotstudio_so100/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..e69a677e6fd1990a934c34a939767e95b04d1b3e --- /dev/null +++ b/robotstudio_so100/payloads/robot.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so_arm100" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "shoulder" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "shoulder_lift" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "elbow_flex" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_flex" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_roll" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "gripper" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + } + + over "upper_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "lower_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "wrist" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "gripper" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "jaw" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/robotstudio_so100/payloads/so101-camera_mount/SO-101_camera_mount.usda b/robotstudio_so100/payloads/so101-camera_mount/SO-101_camera_mount.usda new file mode 100644 index 0000000000000000000000000000000000000000..6684678bb94aefd8951503c3e97c2d0139919229 --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/SO-101_camera_mount.usda @@ -0,0 +1,28 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + doc = """Blender v4.5.3 LTS + +Generated from Composed Stage of root layer /home/gasoto/Downloads/SO-101_camera_mount.usd +""" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend references = @./payloads/base.usda@ +) +{ +} + +def PhysicsScene "PhysicsScene" ( + prepend apiSchemas = ["NewtonSceneAPI"] +) +{ +} + diff --git a/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_BaseColor.png b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..c00f298ce88eb8d6110af2e167b0a00f676dba20 --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1d042502d7d94bca13cee10c63ab5b3801fb0a46e26d79169e13f5b9c7b5a31 +size 16903 diff --git a/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_Black.mdl b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_Black.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f2b6c78951ddffa2e51b279a68b3edccc0120b14 --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_Black.mdl @@ -0,0 +1,43 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Aluminum_Anodized_Black(*) + = OmniPBR( + diffuse_color_constant: color(0.500000, 0.500000, 0.500000), + diffuse_texture: texture_2d("./Aluminum_Anodized_BaseColor.png", ::tex::gamma_srgb), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(0.05f, 0.05f, 0.05f), + reflection_roughness_constant: 0.000000, + reflection_roughness_texture_influence: 1.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.000000, + metallic_texture_influence: 1.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: true, + ORM_texture: texture_2d("./Aluminum_Anodized_ORM.png", ::tex::gamma_linear), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: false, + emissive_color: color(1.000000, 1.000000, 1.000000), + emissive_mask_texture: texture_2d(), + emissive_intensity: 0.000000, + bump_factor: 1.f, + normalmap_texture: texture_2d("./Aluminum_Anodized_Normal.png", ::tex::gamma_linear), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); + diff --git a/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_Normal.png b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..5df7bc7dfc36971b8fa5314b1a98337d2adb46e5 --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6dc1cb1b23a9abd766188a85ccbad1a2639d0a9a334f284e359c6c5d4438608e +size 3321558 diff --git a/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_ORM.png b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..8e7015d41934f1e97892a5ce339e6ab32b629552 --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/Textures/Aluminum_Anodized_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:768f2dbb4f702a9624b912b431efd1a6a8e0ff3e93744cf54f3866ef8f7986e9 +size 637843 diff --git a/robotstudio_so100/payloads/so101-camera_mount/payloads/base.usda b/robotstudio_so100/payloads/so101-camera_mount/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..e5caa5261c1dfa551301eb6b190314c7713a41ba --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/payloads/base.usda @@ -0,0 +1,357 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + doc = """Blender v4.5.3 LTS + +Generated from Composed Stage of root layer /home/gasoto/Downloads/SO-101_camera_mount.usd +""" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "so101_new_calib" +{ + token visibility = "inherited" + quatd xformOp:orient = (0.7071067811865476, 0, 0, 0.7071067811865475) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + def Material "material_a_3d_printed" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "PCB" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.033725403, 0.06344827, 0.01152279) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Lens" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (2e-7, 1.99998e-7, 1.99998e-7) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.08 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Silver" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.18758622, 0.18758433, 0.18758433) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Xform "gripper" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000213627, 0.000245138, -0.025187) + float3 physics:diagonalInertia = (0.000024283923, 0.000043373493, 0.000037722883) + float physics:mass = 0.087 + quatf physics:principalAxes = (0.96742505, 0.008077622, -0.25280195, 0.010714625) + quatd xformOp:orient = (0.5000019669532776, -0.49999964237213135, -0.5000036358833313, -0.4999951124191284) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02061525173485279, -0.2774733006954193, 0.2668520510196686) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "camera_mount" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (6.123233995736766e-17, 8.197998546692573e-18, -0.7071067811865475, -0.7071067811865476) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0039141791838348955, 0.025696293891666135, -0.029035789536837282) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "bolts" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "bolts" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "pcb" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "pcb" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cone" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cone" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rings" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "rings" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "transistors" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "transistors" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "mount" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "mount" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "camera_cover" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "camera_cover" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "focus" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "focus" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "lens" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "lens" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "socket" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "socket" + quatd xformOp:orient = (0.7071067812, 0, 0, -0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + quatd xformOp:orient = (0, 0, 0.7071067812, 0.7071067812) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.003914179184, 0.02569629389, -0.02903578954) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/robotstudio_so100/payloads/so101-camera_mount/payloads/geometries.usd b/robotstudio_so100/payloads/so101-camera_mount/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..4b4c542a0767a1c16f3bf684865ccd5fc1145cde --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ec6117fce2e9b9aee4139070b7f436666a24ef96fd806f92e72e1902ab36149 +size 222444 diff --git a/robotstudio_so100/payloads/so101-camera_mount/payloads/instances.usda b/robotstudio_so100/payloads/so101-camera_mount/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..5f0eb71dab7f3c60863f1f95751876c6d2c722a2 --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/payloads/instances.usda @@ -0,0 +1,1216 @@ +#usda 1.0 +( + customLayerData = { + } + doc = """Blender v4.5.3 LTS + +Generated from Composed Stage of root layer /home/gasoto/Downloads/SO-101_camera_mount.usd +""" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "Cylinder_012" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_012" + { + custom string userProperties:blender:data_name = "Cylinder.012" + } + } + + def Xform "Cube_004" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_004" + { + custom string userProperties:blender:data_name = "Cube.004" + } + } + + def Xform "Cone" ( + prepend references = @./geometries.usd@ + ) + { + over "Cone" + { + custom string userProperties:blender:data_name = "Cone" + } + } + + def Xform "Cylinder_021" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_021" + { + custom string userProperties:blender:data_name = "Cylinder.021" + } + } + + def Xform "Cube_009" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_009" + { + custom string userProperties:blender:data_name = "Cube.009" + } + } + + def Xform "Cylinder_015" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_015" + { + custom string userProperties:blender:data_name = "Cylinder.015" + } + } + + def Xform "Cylinder_019" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_019" + { + custom string userProperties:blender:data_name = "Cylinder.019" + } + } + + def Xform "Cylinder_023" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_023" + { + custom string userProperties:blender:data_name = "Cylinder.023" + } + } + + def Xform "Sphere" ( + prepend references = @./geometries.usd@ + ) + { + over "Sphere" + { + custom string userProperties:blender:data_name = "Sphere" + } + } + + def Xform "Cube_010" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_010" + { + custom string userProperties:blender:data_name = "Cube.010" + } + } + + def Xform "Cube" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube" + { + uniform token purpose = "guide" + } + } + + def Xform "Cube_1" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube" + { + } + } + + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/robotstudio_so100/payloads/so101-camera_mount/payloads/materials.usda b/robotstudio_so100/payloads/so101-camera_mount/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..2e5e15a5485a963513d6beced1e1e1225974c98d --- /dev/null +++ b/robotstudio_so100/payloads/so101-camera_mount/payloads/materials.usda @@ -0,0 +1,502 @@ +#usda 1.0 +( + customLayerData = { + } + doc = """Blender v4.5.3 LTS + +Generated from Composed Stage of root layer /home/gasoto/Downloads/SO-101_camera_mount.usd +""" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "material_a_3d_printed" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 0.82, 0.12) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.1, 0.1, 0.1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Aluminum_Anodized_Black" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../Textures/Aluminum_Anodized_Black.mdl@ + token info:mdl:sourceAsset:subIdentifier = "Aluminum_Anodized_Black" + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor.connect = + float inputs:metallic.connect = + normal3f inputs:normal.connect = + float inputs:opacity = 1 + float inputs:roughness.connect = + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + + def Shader "SimReady_diffuse_texture" + { + token info:id = "UsdUVTexture" + float4 inputs:bias = (0, 0, 0, 0) + asset inputs:file = @./../Textures/Aluminum_Anodized_BaseColor.png@ + float4 inputs:scale = (0.05, 0.05, 0.05, 1) + token inputs:sourceColorSpace = "sRGB" + float2 inputs:st.connect = + token inputs:wrapS = "repeat" + token inputs:wrapT = "repeat" + float outputs:a + float outputs:b + float outputs:g + float outputs:r + float3 outputs:rgb + } + + def Shader "SimReady_ORM_texture" + { + token info:id = "UsdUVTexture" + float4 inputs:bias = (0, 0, 0, 0) + asset inputs:file = @./../Textures/Aluminum_Anodized_ORM.png@ + float4 inputs:scale = (1, 1, 1, 1) + token inputs:sourceColorSpace = "raw" + float2 inputs:st.connect = + token inputs:wrapS = "repeat" + token inputs:wrapT = "repeat" + float outputs:a + float outputs:b + float outputs:g + float outputs:r + float3 outputs:rgb + } + + def Shader "SimReady_normalmap_texture" + { + token info:id = "UsdUVTexture" + float4 inputs:bias = (-1, -1, -1, 0) + asset inputs:file = @./../Textures/Aluminum_Anodized_Normal.png@ + float4 inputs:scale = (2, 2, 2, 1) + token inputs:sourceColorSpace = "raw" + float2 inputs:st.connect = + token inputs:wrapS = "repeat" + token inputs:wrapT = "repeat" + float outputs:a + float outputs:b + float outputs:g + float outputs:r + float3 outputs:rgb + } + } + + def Material "PCB" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.16862702, 0.31724137, 0.057613954) + float inputs:reflection_roughness_constant = 0.58 + float inputs:specular_level = 0.39 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.033725403, 0.06344827, 0.01152279) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Lens" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.000001, 9.9999e-7, 9.9999e-7) + float inputs:reflection_roughness_constant = 0.08 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (2e-7, 1.99998e-7, 1.99998e-7) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.08 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Silver" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.93793106, 0.93792164, 0.93792164) + float inputs:metallic_constant = 1 + float inputs:reflection_roughness_constant = 0.5 + float inputs:specular_level = 1 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.18758622, 0.18758433, 0.18758433) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "DefaultMaterial" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } +} + diff --git a/robotstudio_so100/runnables/physics/mujoco.usda b/robotstudio_so100/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..0293a5dcb98614858956d33afa836dd6bda2f282 --- /dev/null +++ b/robotstudio_so100/runnables/physics/mujoco.usda @@ -0,0 +1,262 @@ +#usda 1.0 +( + defaultPrim = "so_arm100" +) + +def "so_arm100" +{ + over "base" + { + over "collisions" + { + over "Base" + { + over "mesh" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "Rotation_Pitch" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "Upper_Arm" + { + over "mesh_4" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "Lower_Arm" + { + over "mesh_6" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "Wrist_Pitch_Roll" + { + over "mesh_8" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "Fixed_Jaw" + { + over "mesh_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Fixed_Jaw_Motor" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "jaw" + { + over "collisions" + { + over "Moving_Jaw" + { + over "mesh_12" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "shoulder_lift" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "elbow_flex" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "wrist_flex" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "wrist_roll" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "gripper" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_so_arm100_joints_shoulder_pan" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -353.1087316359633, -0.1412434962188903] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35 + double mjc:forceRange:min = -35 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so_arm100_joints_shoulder_lift" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -330.19932093325673, -0.13207973023026037] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35 + double mjc:forceRange:min = -35 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so_arm100_joints_elbow_flex" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -88.38645910552187, -0.035354583263346694] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35 + double mjc:forceRange:min = -35 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so_arm100_joints_wrist_flex" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -333.84115047795086, -0.13353646817396395] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35 + double mjc:forceRange:min = -35 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so_arm100_joints_wrist_roll" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -51.823404629311426, -0.02072936066177755] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35 + double mjc:forceRange:min = -35 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so_arm100_joints_gripper" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -3.794628133503297, -0.0015178513364441462] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35 + double mjc:forceRange:min = -35 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } +} + diff --git a/robotstudio_so100/runnables/physics/newton.usda b/robotstudio_so100/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..d6108b58a8252a3d64bd958e2e64255aa4b1e236 --- /dev/null +++ b/robotstudio_so100/runnables/physics/newton.usda @@ -0,0 +1,200 @@ +#usda 1.0 +( + defaultPrim = "so_arm100" +) + +over "so_arm100" +{ + over "base" + { + over "collisions" + { + over "Base" + { + over "mesh" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "Rotation_Pitch" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "Upper_Arm" + { + over "mesh_4" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "Lower_Arm" + { + over "mesh_6" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "Wrist_Pitch_Roll" + { + over "mesh_8" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "Fixed_Jaw" + { + over "mesh_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + + over "Fixed_Jaw_Motor" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "jaw" + { + over "collisions" + { + over "Moving_Jaw" + { + over "mesh_12" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexDecomposition" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 22.9075 + float newton:damping = 0.763582 + float newton:velocityLimit = 57.295776 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 22.9075 + float newton:damping = 0.763582 + float newton:velocityLimit = 57.295776 + } + + over "elbow_flex" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 22.9075 + float newton:damping = 0.763582 + float newton:velocityLimit = 57.295776 + } + + over "wrist_flex" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 22.9075 + float newton:damping = 0.763582 + float newton:velocityLimit = 57.295776 + } + + over "wrist_roll" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 22.9075 + float newton:damping = 0.763582 + float newton:velocityLimit = 57.295776 + } + + over "gripper" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 22.9075 + float newton:damping = 0.763582 + float newton:velocityLimit = 57.295776 + } + } +} + diff --git a/robotstudio_so100/runnables/physics/physx.usda b/robotstudio_so100/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..8877327607480e6d063c5b0bb51b987ac253d018 --- /dev/null +++ b/robotstudio_so100/runnables/physics/physx.usda @@ -0,0 +1,178 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so_arm100" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "elbow_flex" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "wrist_flex" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "wrist_roll" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + + over "gripper" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 57.295776 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "base" + { + over "collisions" + { + over "Base" + { + over "mesh" + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "Rotation_Pitch" + { + over "mesh_2" + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "Upper_Arm" + { + over "mesh_4" + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "Lower_Arm" + { + over "mesh_6" + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "Wrist_Pitch_Roll" + { + over "mesh_8" + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "Fixed_Jaw" + { + over "mesh_10" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxTriangleMeshCollisionAPI", "PhysxConvexDecompositionCollisionAPI"] + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "Fixed_Jaw_Motor" + { + over "mesh_11" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxTriangleMeshCollisionAPI", "PhysxConvexDecompositionCollisionAPI"] + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "jaw" + { + over "collisions" + { + over "Moving_Jaw" + { + over "mesh_12" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxTriangleMeshCollisionAPI", "PhysxConvexDecompositionCollisionAPI"] + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } +} + diff --git a/robotstudio_so100/so100.usda b/robotstudio_so100/so100.usda new file mode 100644 index 0000000000000000000000000000000000000000..397bf05f0e84659e354570b6814a8be318498ba4 --- /dev/null +++ b/robotstudio_so100/so100.usda @@ -0,0 +1,499 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/so_arm100" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/so_arm100" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/so_arm100" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.110925, 0.3138494, 0.17550161) + string asset_license = "Apache-2.0" + string asset_name = "so100" + string asset_type = "robot" + string author = "RobotStudio" + string category = "robotic arm" + double mass = 1.6089653838425875 + dictionary omni_layer = { + string authoring_layer = "./so100.usda" + } + string qcode = "Q40687" + dictionary renderSettings = { + } + int rigid_body_count = 7 + string source_file = "RobotStudio/so100/so100.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "so_arm100" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so_arm100" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Robot = "none" + string Sensor = "none" + } + variantSets = ["Robot", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "base" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + + over "collisions" + { + token visibility = "invisible" + } + } + + over "shoulder" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "upper_arm" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "lower_arm" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + + over "collisions" + { + token visibility = "invisible" + } + } + + over "wrist" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "gripper" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + + over "visuals" + { + token visibility = "inherited" + + over "Fixed_Jaw" + { + token visibility = "inherited" + } + + over "Fixed_Jaw_Motor" + { + token visibility = "inherited" + } + } + + over "collisions" + { + uniform token purpose = "guide" + token visibility = "invisible" + } + } + + over "jaw" + { + over "collisions" + { + uniform token purpose = "guide" + token visibility = "invisible" + } + } + variantSet "Robot" = { + "none" ( + prepend payload = @./payloads/Robot/none.usda@ + ) { + + } + "robot" ( + prepend payload = @./payloads/Robot/robot.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + +def "Render" ( + hide_in_stage_window = true + no_delete = true +) +{ + def "OmniverseKit" + { + def "HydraTextures" ( + hide_in_stage_window = true + no_delete = true + ) + { + def RenderProduct "omni_kit_widget_viewport_ViewportTexture_0" ( + prepend apiSchemas = ["OmniRtxSettingsCommonAdvancedAPI_1", "OmniRtxSettingsRtAdvancedAPI_1", "OmniRtxSettingsPtAdvancedAPI_1", "OmniRtxSettingsParticleFieldAPI_1", "OmniRtxPostColorGradingAPI_1", "OmniRtxPostChromaticAberrationAPI_1", "OmniRtxPostBloomPhysicalAPI_1", "OmniRtxPostMatteObjectAPI_1", "OmniRtxPostCompositingAPI_1", "OmniRtxPostDofAPI_1", "OmniRtxPostMotionBlurAPI_1", "OmniRtxPostTvNoiseAPI_1", "OmniRtxPostTonemapIrayReinhardAPI_1", "OmniRtxPostDebugSettingsAPI_1", "OmniRtxDebugSettingsAPI_1"] + hide_in_stage_window = true + no_delete = true + ) + { + token omni:rtx:ambientOcclusion:denoiserMode = "none" + token omni:rtx:background:source:texture:textureMode = "repeatMirrored" + token omni:rtx:background:source:type = "domeLight" + bool omni:rtx:debug:view:pixelDebug:enableFixedTextPos = 1 + token omni:rtx:directLighting:sampledLighting:denoisingTechnique = "None" + bool omni:rtx:dlss:frameGeneration = 0 + bool omni:rtx:indirectDiffuse:denoiser:enabled = 0 + bool omni:rtx:material:db:syncLoads = 1 + token omni:rtx:post:dlss:execMode = "performance" + bool omni:rtx:post:registeredCompositing:invertColorCorrection = 1 + bool omni:rtx:post:registeredCompositing:invertToneMap = 1 + bool omni:rtx:pt:adaptiveSampling:filterError = 0 + uint omni:rtx:pt:adaptiveSampling:fixedSppIterations = 2 + uint omni:rtx:pt:maxSamplesPerLaunch = 2073600 + uint omni:rtx:pt:mgpu:maxPixelsPerRegionExponent = 12 + bool omni:rtx:reflections:denoiser:enabled = 0 + token omni:rtx:rendermode = "RealTimePathTracing" + color3f omni:rtx:rt:ambientLight:color = (0.1, 0.1, 0.1) + bool omni:rtx:rt:demoire = 0 + bool omni:rtx:rt:lightcache:spatialCache:dontResolveConflicts = 1 + int omni:rtx:rt:sss:samples = 1 + uint omni:rtx:rtpt:maxVolumeBounces = 15 + float omni:rtx:rtpt:modulatingRoughnessThreshold = 0.08 + bool omni:rtx:scene:hydra:materialSyncLoads = 1 + bool omni:rtx:scene:hydra:mdlMaterialWarmup = 1 + rel orderedVars = + custom bool overrideClipRange = 0 + uniform int2 resolution = (1280, 720) + } + } + } + + def RenderSettings "OmniverseGlobalRenderSettings" ( + prepend apiSchemas = ["OmniRtxSettingsGlobalRtAdvancedAPI_1", "OmniRtxSettingsGlobalPtAdvancedAPI_1"] + no_delete = true + ) + { + rel products = + } + + def "Vars" ( + hide_in_stage_window = true + no_delete = true + ) + { + def RenderVar "LdrColor" ( + hide_in_stage_window = true + no_delete = true + ) + { + uniform string sourceName = "LdrColor" + uniform token sourceType = "raw" + } + } +} + diff --git a/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..625204b651a7afee7136aa069eaa2b1116d3516b --- /dev/null +++ b/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:30", + "assets": [ + { + "asset": "so101_new_calib.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.packaging.bom.json b/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..0f1445f1d12e8fb99808a8d21fceaba48d7d21b3 --- /dev/null +++ b/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,279 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.so101_new_calib.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "ad399b0f252a3421f48f1d521da0fae14a3f32d46b863b7ec7543233f16c3b06", + "sha256": "5f7c0b4c14ecde6a1f5b0f86d19681a8c387dcaf352934a89d0ae842a4131a67" + } + }, + { + "relative_path": ".thumbs/256x256/so101_new_calib.usda.png", + "size": 48104, + "hash": { + "sha256-flat-1mb": "050ff5d66f0afbfc743ba71bc66f9ec3179b9924c24a0815d26b2aeafa9d683a", + "sha256": "1971a86735cf1aee75d586988ef5130d1e3b1fa77155b905ac7b4e575bbfe44d" + } + }, + { + "relative_path": ".thumbs/so101_new_calib.thumb.usd", + "size": 6132, + "hash": { + "sha256-flat-1mb": "4a9c7e07c29c80fd3a77fac04ad659b85a5a07651f219a01caa074fdf59bd38b", + "sha256": "f803a817b62017bc9142998856649d33ea9f37684694e9e9a855f94899cc2fbb" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 4572, + "hash": { + "sha256-flat-1mb": "4c95f72842ed0c5b82d0398178071ca34da7bf61318b4cf4de9fdcc20f2333d4", + "sha256": "e5491a7b9ce9e43cfa2d12ec0b300e2b636e07c65eb69fea2a337a9c2b16e616" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "1ab9760654ab710763793529bc6243eed9987ab3b3b0a3ab0bf0fb8855f5bbb2", + "sha256": "cda14b6bd38510a9337bc5a224af6ca474b4a1a328b980af413f5794ee692385" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 20378, + "hash": { + "sha256-flat-1mb": "466c97ca11f148427d28c264ff3baea74800471b2cc99bbdb190260a0e0653b0", + "sha256": "6a32a467492ae963700a9349fafa2093483fff8227a0ee930ed744a0f3a5707c" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1516, + "hash": { + "sha256-flat-1mb": "3ab22182a3b865b0318e22996b7a61d9fb55e80cb2a13df843db67324c8ffb71", + "sha256": "88a734d72b16a63304062a7618a31f0fa2a64e90c96ee9a086aef59090488326" + } + }, + { + "relative_path": "payloads/Robot/none.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "1ab9760654ab710763793529bc6243eed9987ab3b3b0a3ab0bf0fb8855f5bbb2", + "sha256": "cda14b6bd38510a9337bc5a224af6ca474b4a1a328b980af413f5794ee692385" + } + }, + { + "relative_path": "payloads/Robot/robot.usda", + "size": 5103, + "hash": { + "sha256-flat-1mb": "562fbf66534b019a1bfd65325e7397aea708c559a2b939ae8b0100d7b8fc4b0e", + "sha256": "30a8b9f599b28713adb6807f8328dc12edfdb7441f71fd4997c0ed6ba64eafda" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "1ab9760654ab710763793529bc6243eed9987ab3b3b0a3ab0bf0fb8855f5bbb2", + "sha256": "cda14b6bd38510a9337bc5a224af6ca474b4a1a328b980af413f5794ee692385" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 231, + "hash": { + "sha256-flat-1mb": "a52872a73878ddee40ae5a7f4b68c1fddb83299392b29bb8ba69719947c9da53", + "sha256": "24305dd2f85b0868a336825ece5beb987a804afe6aacbf25078c955164d3e7b6" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 39592, + "hash": { + "sha256-flat-1mb": "d908818c0cebd16408a790fda4a1eb4813cd5595c779a3bcf453fd3879e10cc2", + "sha256": "d47ea4f37c722591cfcba988da2cb65d8bcfbf8c33cc1672d7dd415784e2a3d7" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 23256984, + "hash": { + "sha256-flat-1mb": "e70637613e77415ccfe5f3d9bc81551aa26adb3510903c943aa941f78f94a0b0", + "sha256": "6c74f18b3c3d52c4426160b333f58a98b310db1fb6d85fe4516353e1bafc9091", + "sha256-first1m": "184d7aca77e0bd7ab61070b5b8cd7f11a92b0e39b63da5030a40c9a9d82286c5" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 43013, + "hash": { + "sha256-flat-1mb": "cf9639c12d0fea3e03d082e02b467429d94fa8f765a1cf768265d7351f561cb1", + "sha256": "821abe5d1f5570f37e177ab5125de0afd9e7dbe7dc4e4a5684d0db541db632ae" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 10384, + "hash": { + "sha256-flat-1mb": "28ac02a943546da96e9d2d44b38e28faeec0c0fee43503dd5a721b8c38784ee5", + "sha256": "5dbef810e6524108967ffd885a456035c2b2dfccf39cae81b6484183984037bb" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 5772, + "hash": { + "sha256-flat-1mb": "8ce6fe098180f6c99f7bdcc321a09c09176c37965672530d734ec161abfb3084", + "sha256": "a8200f56de5b9552e89324821eac9d7f701fe9f9f1bb0b20b5b3931ab02e4d2e" + } + }, + { + "relative_path": "payloads/so101-camera_mount/SO-101_camera_mount.usda", + "size": 281, + "hash": { + "sha256-flat-1mb": "825a2fc72e2060e7af1245a420b304f770ec24bc6ecae8cd70f07a0e53ddbefc", + "sha256": "0f5bdea7c8b44183bf60341af648f3dc74feae82b1f681e610433f7fa8b4b608" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/base.usda", + "size": 18528, + "hash": { + "sha256-flat-1mb": "34a24f5d86780a89ecfc6f0c23d52985f2fb6f9ba180f0693aca58f1baab1018", + "sha256": "6ffa11a8f23182eaf38605ef22891be6ce308341216bcfcaff99fa2191db588f" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/geometries.usd", + "size": 4523559, + "hash": { + "sha256-flat-1mb": "ff54db8c572ea09fde3b93e6abbb83312e34f38e905174ebba8f0b32fcf5200d", + "sha256": "40da4f4dea87771f6c0cdaeb71cf343cacb06ebd032f04339474a50499fb90e8", + "sha256-first1m": "0f29eae94c6fa8c5431c45d5c2a04df0b760ebbfde905f543a0cef8ec2f5c441" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/instances.usda", + "size": 3888, + "hash": { + "sha256-flat-1mb": "66947ced94f505d29d7df468989da3f7f23c36ae817e92e1733619e4fd24911a", + "sha256": "b2a3cb9a2e20986012a855c49b1f1da61e7a0fef224282bf1b54e02fbdc74c4b" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/materials.usda", + "size": 8667, + "hash": { + "sha256-flat-1mb": "9ba909d924659a1bde27af3b83c13847ad09ebfe4fec556360af7eac9e845277", + "sha256": "b645538c88a57ea1f384fcf99ad9a9bf819c6e02ac6273010611ddf4af54b784" + } + }, + { + "relative_path": "payloads/so101-camera_mount/source_assets/OmniPBR.mdl", + "size": 13989, + "hash": { + "sha256-flat-1mb": "4d0f54d47017bfbe22cc483cb02c4fe7e2254ddd1119cd618cbaea553639d52c", + "sha256": "d384fc800f120e3cad1b7ca8837f9c554f9c34343d194813fca27caa493001f2" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 16414, + "hash": { + "sha256-flat-1mb": "7503fd3454db328bd9f4956d37346a2d9b1ce6c23a8f5ce7b77362dc4dff520f", + "sha256": "b7714b6a5a3e45a294e7528a37c7be8a4e8d00677fffc973b964d8335f812d52" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 13460, + "hash": { + "sha256-flat-1mb": "1691c6a1e8c6c95eecc96b45340388a5b527201bc30e1310e92df26cb47a8174", + "sha256": "397e96300f5fcd0b34d5c76c66638596ee0e527a4176a0a748260b827e9fc305" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 10992, + "hash": { + "sha256-flat-1mb": "7cce6830200a65c9ac6da177b7d8e9fe8168febb6092de921e3c5de51ce1bdda", + "sha256": "045cca761c30a13f1e04d46446b42a1584ed12d1e88313780ca27890af006243" + } + }, + { + "relative_path": "so101_new_calib.usda", + "size": 16980, + "hash": { + "sha256-flat-1mb": "be7e50f701bc63d2f38936f60b7807fd57407b8acf8d381a10a1f11f5e9b2238", + "sha256": "c2c0fcdb6667185876d00b9e35a85a8f07f580b2abda99b30a64c87836634d71" + } + } + ] +} \ No newline at end of file diff --git a/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.root_usds.json b/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..1c2c69d3f2fc815a9c5d9a0d9979e6f745409cf8 --- /dev/null +++ b/robotstudio_so101_new_calib/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "so101_new_calib.usda" + ] +} diff --git a/robotstudio_so101_new_calib/.metadata/license.txt b/robotstudio_so101_new_calib/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/robotstudio_so101_new_calib/.metadata/license.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/robotstudio_so101_new_calib/.simready/validation.json b/robotstudio_so101_new_calib/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/robotstudio_so101_new_calib/.simready/validation.json @@ -0,0 +1,223 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/robotstudio_so101_new_calib/.thumbs/256x256/.so101_new_calib.usda.last_generated b/robotstudio_so101_new_calib/.thumbs/256x256/.so101_new_calib.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..357658f6a5fbf99a4296350d34f9342069dad9f4 --- /dev/null +++ b/robotstudio_so101_new_calib/.thumbs/256x256/.so101_new_calib.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:41:02 \ No newline at end of file diff --git a/robotstudio_so101_new_calib/.thumbs/256x256/so101_new_calib.usda.png b/robotstudio_so101_new_calib/.thumbs/256x256/so101_new_calib.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..b49fea8639a05b362b58cd1d4f389215406d775d --- /dev/null +++ b/robotstudio_so101_new_calib/.thumbs/256x256/so101_new_calib.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1971a86735cf1aee75d586988ef5130d1e3b1fa77155b905ac7b4e575bbfe44d +size 48104 diff --git a/robotstudio_so101_new_calib/.thumbs/so101_new_calib.thumb.usd b/robotstudio_so101_new_calib/.thumbs/so101_new_calib.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..9ded61362aca7199d7d221a6e82913b81cfc6f36 Binary files /dev/null and b/robotstudio_so101_new_calib/.thumbs/so101_new_calib.thumb.usd differ diff --git a/robotstudio_so101_new_calib/com.nvidia.simready.packaging.json b/robotstudio_so101_new_calib/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..401abe249d32061b4dc1ec2f7f9f3e5ae03dd14c --- /dev/null +++ b/robotstudio_so101_new_calib/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "robotstudio_so101_new_calib.1.0.0", + "license": "Apache-2.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "a4fe50bd14ba6b4470e0faea63c85d6f1aa250af81d7d6204067576188fa04ae" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "f513ab19357e6f5394b16ef589cb9fde73d1dfeb8140fad321a21ecb119003fd" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "00616225482a092cace64f0a12042d9f1921d2958503f2d146d18c3e6ad3e2ef" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + } + } + ], + "content_hash": { + "sha256": "74a37bc680f53ff5080848294df9054f20d77851a205cff481d66fc6382cb496" + }, + "package_hash": { + "sha256": "6633ee43485307225d37d3582849897abed9ec6a313ca7963cd1b71a7397c004" + } +} diff --git a/robotstudio_so101_new_calib/materials/mdl/LICENSE.md b/robotstudio_so101_new_calib/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/robotstudio_so101_new_calib/materials/mdl/OmniPBR.mdl b/robotstudio_so101_new_calib/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_so101_new_calib/materials/mdl/OmniPBRBase.mdl b/robotstudio_so101_new_calib/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/robotstudio_so101_new_calib/materials/mdl/OmniPBR_ClearCoat.mdl b/robotstudio_so101_new_calib/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_so101_new_calib/materials/mdl/aux_definitions.mdl b/robotstudio_so101_new_calib/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/robotstudio_so101_new_calib/materials/mdl/core_definitions.mdl b/robotstudio_so101_new_calib/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/robotstudio_so101_new_calib/materials/mdl/support_definitions.mdl b/robotstudio_so101_new_calib/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/robotstudio_so101_new_calib/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/robotstudio_so101_new_calib/payloads/Physics/mujoco.usda b/robotstudio_so101_new_calib/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..0acc9bf4a232edda91b11df06afd0e8ed82a5ae6 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Physics/mujoco.usda @@ -0,0 +1,276 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" +{ + over "base" + { + over "baseframe" + { + } + + over "visuals" + { + over "base_motor_holder_so101_v1" + { + } + + over "base_so101_v2" + { + } + + over "sts3215_03a_v1" + { + } + + over "waveshare_mounting_plate_so101_v2" + { + } + } + + over "collisions" + { + over "base_motor_holder_so101_v1" + { + } + + over "base_so101_v2" + { + } + + over "sts3215_03a_v1" + { + } + + over "waveshare_mounting_plate_so101_v2" + { + } + } + } + + over "shoulder" + { + over "visuals" + { + over "sts3215_03a_v1" + { + } + + over "motor_holder_so101_base_v1" + { + } + + over "rotation_pitch_so101_v1" + { + } + } + + over "collisions" + { + over "sts3215_03a_v1" + { + } + + over "motor_holder_so101_base_v1" + { + } + + over "rotation_pitch_so101_v1" + { + } + } + } + + over "joints" + { + over "shoulder_pan" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "shoulder_lift" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "elbow_flex" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "wrist_flex" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "wrist_roll" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "gripper" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "upper_arm" + { + over "visuals" + { + over "sts3215_03a_v1" + { + } + + over "upper_arm_so101_v1" + { + } + } + + over "collisions" + { + over "sts3215_03a_v1" + { + } + + over "upper_arm_so101_v1" + { + } + } + } + + over "lower_arm" + { + over "visuals" + { + over "under_arm_so101_v1" + { + } + + over "motor_holder_so101_wrist_v1" + { + } + + over "sts3215_03a_v1" + { + } + } + + over "collisions" + { + over "under_arm_so101_v1" + { + } + + over "motor_holder_so101_wrist_v1" + { + } + + over "sts3215_03a_v1" + { + } + } + } + + over "wrist" + { + over "visuals" + { + over "sts3215_03a_no_horn_v1" + { + } + + over "wrist_roll_pitch_so101_v2" + { + } + } + + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + } + + over "wrist_roll_pitch_so101_v2" + { + } + } + } + + over "gripper" + { + over "gripperframe" + { + } + + over "visuals" + { + over "sts3215_03a_v1" + { + } + + over "wrist_roll_follower_so101_v1" + { + } + } + + over "collisions" + { + over "sts3215_03a_v1" + { + } + + over "wrist_roll_follower_so101_v1" + { + } + } + } + + over "moving_jaw_so101_v1" + { + over "visuals" + { + over "moving_jaw_so101_v1" + { + } + } + + over "collisions" + { + over "moving_jaw_so101_v1" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + over "material_a_d_printed" + { + } + + over "material_sts3215" + { + } + } + + over "VisualMaterials" + { + } +} + diff --git a/robotstudio_so101_new_calib/payloads/Physics/none.usda b/robotstudio_so101_new_calib/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c141bd0fdeb0d3a2bb061287f669b5c4029021ba --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so101_new_calib" +{ +} + diff --git a/robotstudio_so101_new_calib/payloads/Physics/physics.usda b/robotstudio_so101_new_calib/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..a5c43ca3021ceff9a5d107583860f6b041a8cb2f --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Physics/physics.usda @@ -0,0 +1,599 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" +{ + over "base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.020739, 0.0020428703, 0.065966) + float3 physics:diagonalInertia = (0.00013612688, 0.00011323285, 0.00013180728) + float physics:mass = 0.147 + quatf physics:principalAxes = (0.98998284, 0.14075965, 0.0025164415, 0.010700988) + + over "collisions" + { + over "base_motor_holder_so101_v1" ( + instanceable = false + ) + { + over "mesh" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "base_so101_v2" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "waveshare_mounting_plate_so101_v2" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "shoulder" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0307604, -0.0000166727, -0.0252713) + float3 physics:diagonalInertia = (0.00008378355, 0.00008103881, 0.00002395524) + float physics:mass = 0.100006 + quatf physics:principalAxes = (0.9998646, 0.0014956784, 0.009708396, 0.013204301) + + over "collisions" + { + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "motor_holder_so101_base_v1" ( + instanceable = false + ) + { + over "mesh_4" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "rotation_pitch_so101_v1" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "joints" + { + def PhysicsRevoluteJoint "shoulder_pan" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00012374051 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 0.30935127 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00049496203 + point3f physics:localPos0 = (0.0207909, -0.0230745, 0.0948817) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (8.963205e-7, -0.7071055, -0.7071081, 8.9632374e-7) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -109.99987 + float physics:upperLimit = 109.99987 + } + + def PhysicsRevoluteJoint "shoulder_lift" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0010487421 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 2.6218553 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0041949684 + point3f physics:localPos0 = (-0.0303992, -0.0182778, -0.0542) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.4999982, -0.5, -0.5, -0.50000185) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -100.00004 + float physics:upperLimit = 100.00004 + } + + def PhysicsRevoluteJoint "elbow_flex" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0021143605 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 5.285901 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.008457442 + point3f physics:localPos0 = (-0.11257, -0.028, 2.46331e-16) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -6.378481e-16, -2.3060708e-16, 0.7071081) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -96.829865 + float physics:upperLimit = 96.829865 + } + + def PhysicsRevoluteJoint "wrist_flex" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0019202452 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 4.8006134 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.007680981 + point3f physics:localPos0 = (-0.1349, 0.0052, 1.65232e-16) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 2.1600662e-15, -1.3619623e-16, -0.7071081) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -94.99983 + float physics:upperLimit = 94.99983 + } + + def PhysicsRevoluteJoint "wrist_roll" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00030111347 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 0.75278366 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0012044539 + point3f physics:localPos0 = (0, -0.0611, 0.0181) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (8.631542e-7, 9.2948994e-7, 0.7071081, 0.7071055) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -157.21101 + float physics:upperLimit = 162.78932 + } + + def PhysicsRevoluteJoint "gripper" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00001512667 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 0.037816677 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00006050668 + point3f physics:localPos0 = (0.0202, 0.0188, -0.0234) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, -4.92038e-15, -4.8840093e-15) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -10.000004 + float physics:upperLimit = 100.00004 + } + } + + over "upper_arm" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0898471, -0.00838224, 0.0184089) + float3 physics:diagonalInertia = (0.000037245056, 0.00015087317, 0.000142487) + float physics:mass = 0.103 + quatf physics:principalAxes = (0.9960497, 0.0009638968, -0.00009570287, 0.08879216) + + over "collisions" + { + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "upper_arm_so101_v1" ( + instanceable = false + ) + { + over "mesh_6" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "lower_arm" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0980701, 0.00324376, 0.0182831) + float3 physics:diagonalInertia = (0.00002831246, 0.00016026171, 0.00014530364) + float physics:mass = 0.104 + quatf physics:principalAxes = (0.999589, 0.00089328334, 0.0053831167, -0.028146055) + + over "collisions" + { + over "under_arm_so101_v1" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "motor_holder_so101_wrist_v1" ( + instanceable = false + ) + { + over "mesh_8" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "wrist" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.000103312, -0.0386143, 0.0281156) + float3 physics:diagonalInertia = (0.000036826477, 0.000027447379, 0.000018943445) + float physics:mass = 0.079 + quatf physics:principalAxes = (0.9671435, 0.2542262, 0.0016222623, -0.00014630717) + + over "collisions" + { + over "sts3215_03a_no_horn_v1" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "wrist_roll_pitch_so101_v2" ( + instanceable = false + ) + { + over "mesh_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "gripper" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00021362693, 0.000245138, -0.025187) + float3 physics:diagonalInertia = (0.000024283927, 0.000043373497, 0.000037722893) + float physics:mass = 0.087 + quatf physics:principalAxes = (0.96742505, 0.008077627, -0.252802, 0.010714627) + + over "collisions" + { + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" ( + instanceable = false + ) + { + over "Cube_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_13" ( + instanceable = false + ) + { + over "Cube_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_09" ( + instanceable = false + ) + { + over "Cube_09" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_013" ( + instanceable = false + ) + { + over "Cube_013" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_12" ( + instanceable = false + ) + { + over "Cube_12" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_10" ( + instanceable = false + ) + { + over "Cube_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + } + } + } + + over "moving_jaw_so101_v1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00157495, -0.0300244, 0.0192755) + float3 physics:diagonalInertia = (0.000006635825, 0.0000018652258, 0.00000529092) + float physics:mass = 0.012 + quatf physics:principalAxes = (0.99930465, 0.016051318, -0.0010975002, -0.033638127) + + over "collisions" + { + over "Cube_05" ( + instanceable = false + ) + { + over "Cube_05" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_02" ( + instanceable = false + ) + { + over "Cube_02" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_06" ( + instanceable = false + ) + { + over "Cube_06" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_03" ( + instanceable = false + ) + { + over "Cube_03" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cylinder_02" ( + instanceable = false + ) + { + over "Cylinder_02" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_07" ( + instanceable = false + ) + { + over "Cube_07" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_007" ( + instanceable = false + ) + { + over "Cube_007" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_04" ( + instanceable = false + ) + { + over "Cube_04" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cylinder_01" ( + instanceable = false + ) + { + over "Cylinder_01" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/robotstudio_so101_new_calib/payloads/Physics/physx.usda b/robotstudio_so101_new_calib/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..f938d1340553d7b2d9d133462ad4cce416859e91 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "so101_new_calib" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "elbow_flex" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "wrist_flex" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "wrist_roll" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "gripper" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 1 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/robotstudio_so101_new_calib/payloads/Robot/none.usda b/robotstudio_so101_new_calib/payloads/Robot/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c141bd0fdeb0d3a2bb061287f669b5c4029021ba --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Robot/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so101_new_calib" +{ +} + diff --git a/robotstudio_so101_new_calib/payloads/Robot/robot.usda b/robotstudio_so101_new_calib/payloads/Robot/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..8b7bb82fa451fdd68f606dff98da62b0d46cba0c --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Robot/robot.usda @@ -0,0 +1,182 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] + + over "base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "shoulder" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "shoulder_lift" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "elbow_flex" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_flex" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_roll" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "gripper" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + } + + over "upper_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "lower_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "wrist" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "gripper" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "moving_jaw_so101_v1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } +} + diff --git a/robotstudio_so101_new_calib/payloads/Sensor/none.usda b/robotstudio_so101_new_calib/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c141bd0fdeb0d3a2bb061287f669b5c4029021ba --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so101_new_calib" +{ +} + diff --git a/robotstudio_so101_new_calib/payloads/Sensor/sensors.usda b/robotstudio_so101_new_calib/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..5573b2bac99092adbe1e5b57811a54d36ef8313b --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/Sensor/sensors.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend references = @../so101-camera_mount/SO-101_camera_mount.usda@ +) +{ +} + diff --git a/robotstudio_so101_new_calib/payloads/base.usda b/robotstudio_so101_new_calib/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..718e434250f54847ff14c1db076b64ddd40d740a --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/base.usda @@ -0,0 +1,889 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "so101_new_calib" +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "base" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "baseframe" + { + quatd xformOp:orient = (1, 1.3877799388343032e-17, -4.763979934278074e-30, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079099975526333, 0.01576079986989498, 0.03248170018196106) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "base_motor_holder_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02069149911, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "base_so101_v2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0, 0, -0.707108045) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, -0.01057450008, 0.07618170232) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "waveshare_mounting_plate_so101_v2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02059149928, 0.04674350098, 0.07988169789) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "base_motor_holder_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02069149911, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "base_so101_v2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0, 0, -0.707108045) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, -0.01057450008, 0.07618170232) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "waveshare_mounting_plate_so101_v2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02059149928, 0.04674350098, 0.07988169789) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "shoulder" + { + quatd xformOp:orient = (8.963205004874908e-7, -0.7071055173873901, -0.7071080803871155, 8.963237405623659e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917242527, -0.023074500262737274, 0.09488169848918915) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.03039919958, 0.0004222409916, -0.04170000181) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_base_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, -0.4999999801, 0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06759919971, -0.0001777589932, 0.0158498995) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rotation_pitch_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.01220079977, 0.00002224130003, 0.04639999941) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.03039919958, 0.0004222409916, -0.04170000181) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_base_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, -0.4999999801, 0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06759919971, -0.0001777589932, 0.0158498995) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rotation_pitch_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.01220079977, 0.00002224130003, 0.04639999941) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Scope "joints" + { + } + + def Xform "upper_arm" + { + quatd xformOp:orient = (-0.7071058750152588, 0.000003845626451948192, -0.7071077823638916, -0.0000012814998626708984) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0025133490562438965, -0.05347376689314842, 0.149081751704216) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (8.963205005e-7, -0.7071054997, 0.7071080627, -8.963237181e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1125700027, -0.01549999975, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "upper_arm_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06508500129, 0.0120000001, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (8.963205005e-7, -0.7071054997, 0.7071080627, -8.963237181e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1125700027, -0.01549999975, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "upper_arm_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06508500129, 0.0120000001, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "lower_arm" + { + quatd xformOp:orient = (-0.4999975860118866, -0.49999889731407166, -0.5000025629997253, -0.5000011920928955) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.00251384056173265, -0.08147336542606354, 0.261651873588562) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "under_arm_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_wrist_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01799999923) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0, 0.000001267590847, -1, 0.000001267590847) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1224000007, 0.005200000014, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "under_arm_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_wrist_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01799999923) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0, 0.000001267590847, -1, 0.000001267590847) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1224000007, 0.005200000014, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "wrist" + { + quatd xformOp:orient = (-0.7071059346199036, 0.000003874301910400391, -0.7071078419685364, -0.0000012516975402832031) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.002514801686629653, -0.21637339890003204, 0.26685187220573425) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_no_horn_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755e-17, -0.04239999875, 0.03060000017) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_pitch_so101_v2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, -0.4999999801, -0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.02800000086, 0.01810000092) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_no_horn_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755e-17, -0.04239999875, 0.03060000017) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_pitch_so101_v2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, -0.4999999801, -0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.02800000086, 0.01810000092) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "gripper" + { + quatd xformOp:orient = (0.5000019669532776, -0.49999964237213135, -0.5000036358833313, -0.4999951124191284) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02061525173485279, -0.2774733006954193, 0.2668520510196686) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "gripperframe" + { + quatd xformOp:orient = (0.49999821186065674, 0.5, 0.500001847743988, 0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.007899999618530273, -0.0002181210002163425, -0.09812740236520767) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.007699999958, 0.00009999999747, -0.02339999937) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_follower_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755e-17, -0.0002182140015, 0.0009497060091) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.007699999958, 0.00009999999747, -0.02339999937) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_follower_so101_v1" + { + uniform token purpose = "guide" + custom string userProperties:blender:object_name = "gripper_col" + token visibility = "invisible" + quatd xformOp:orient = (0.7071067811865476, 0, 0.7071067811865475, 0) + float3 xformOp:rotateXYZ = (0, -90, -180) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755337213e-17, -0.000218214001506567, 0.0009497060091234744) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "Cube_11" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07446918052, 2.303949029e-9, -0.01855467064) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_13" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02389621895, -2.697642773e-18, -0.02202789289) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_09" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.09953665893, 2.071118385e-9, -0.0119890998) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_013" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0236068384, 2.769610316e-9, -0.007172210041) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_12" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05387327235, 2.071118385e-9, -0.02307547433) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_10" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.08926332157, 2.071118385e-9, -0.01510555846) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + } + } + } + + def Xform "moving_jaw_so101_v1" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + quatd xformOp:orient = (0.7071079611778259, 0.0000029206275939941406, -0.7071058750152588, 0.0000073015689849853516) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.03941557556390762, -0.3008729815483093, 0.2870521545410156) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "moving_jaw_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-5.551119755e-17, -1.947459937e-17, 0.01889999956) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Cube_05" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0006168186665000408, -0.036364406350000045, 0.018899998654279482) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_02" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.007896840572000074, -0.07659551501000006, 0.01889999888711012) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_06" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.00033348798749999187, -0.017924129960000035, 0.018899997257295624) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_03" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.004521667957000042, -0.06644535065000001, 0.01889999888711012) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cylinder_02" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.000362992286699948, 0.0005430579184999562, 0.03941918722892563) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_07" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0002458095550999517, -0.007311433553999991, -0.001999812201074383) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_007" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0002458095550999517, -0.007311433554000046, 0.03979982994892562) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_04" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0018609762190000545, -0.05629521608000004, 0.01889999865427948) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cylinder_01" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.000362992286699948, 0.0005430579184999562, -0.0016191694910743792) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Scope "Looks" + { + def Material "material_a_d_printed" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/robotstudio_so101_new_calib/payloads/geometries.usd b/robotstudio_so101_new_calib/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..9aeef5cfc896cb8d79beb9f5e8bf865b3579f71e --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c74f18b3c3d52c4426160b333f58a98b310db1fb6d85fe4516353e1bafc9091 +size 23256984 diff --git a/robotstudio_so101_new_calib/payloads/instances.usda b/robotstudio_so101_new_calib/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..ef44cabd089ac085ce35aba89683400a89ce4372 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/instances.usda @@ -0,0 +1,1300 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "Cube_11" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_11" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.010" + } + } + + def Xform "Cube_13" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_13" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.012" + } + } + + def Xform "Cube_09" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_09" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.008" + } + } + + def Xform "Cube_013" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_013" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.013" + } + } + + def Xform "Cube_12" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_12" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.011" + } + } + + def Xform "Cube_10" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_10" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.009" + } + } + + def Xform "Cube_05" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_05" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.004" + } + } + + def Xform "Cube_02" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_02" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.001" + } + } + + def Xform "Cube_06" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_06" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.005" + } + } + + def Xform "Cube_03" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_03" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.002" + } + } + + def Xform "Cylinder_02" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_02" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cylinder.001" + } + } + + def Xform "Cube_07" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_07" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.006" + } + } + + def Xform "Cube_007" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_007" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.007" + } + } + + def Xform "Cube_04" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_04" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.003" + } + } + + def Xform "Cylinder_01" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_01" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cylinder" + } + } +} + diff --git a/robotstudio_so101_new_calib/payloads/materials.usda b/robotstudio_so101_new_calib/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..e2bbb90de8501c9cee196c1b814023026a915d3c --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/materials.usda @@ -0,0 +1,289 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "DefaultMaterial" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_a_d_printed" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 0.82, 0.12) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_sts3215" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.1, 0.1, 0.1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/robotstudio_so101_new_calib/payloads/robot.usda b/robotstudio_so101_new_calib/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..408a44df5d7b0b037efed16da98c418bd6d1c39f --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/robot.usda @@ -0,0 +1,204 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "baseframe" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "shoulder" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "shoulder_lift" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "elbow_flex" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_flex" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_roll" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "gripper" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + } + + over "upper_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "lower_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "wrist" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "gripper" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "gripperframe" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "moving_jaw_so101_v1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/robotstudio_so101_new_calib/payloads/so101-camera_mount/SO-101_camera_mount.usda b/robotstudio_so101_new_calib/payloads/so101-camera_mount/SO-101_camera_mount.usda new file mode 100644 index 0000000000000000000000000000000000000000..b48c2b224bb4d7bb91782fd4d6ff8447eb5199f4 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/so101-camera_mount/SO-101_camera_mount.usda @@ -0,0 +1,18 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend references = @./payloads/base.usda@ +) +{ +} + diff --git a/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/base.usda b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..aa71844080d1fcf8fb89210b3084c582c236c236 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/base.usda @@ -0,0 +1,412 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + doc = """Generated from Composed Stage of root layer /tmp/wowrobo_camera/payloads/base.usd +""" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "so101_new_calib" +{ + token visibility = "inherited" + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + def Material "material_a_3d_printed" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "PCB" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.033725403, 0.06344827, 0.01152279) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Lens" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (2e-7, 1.99998e-7, 1.99998e-7) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.08 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Silver" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.18758622, 0.18758433, 0.18758433) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Xform "gripper" ( + apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000213627, 0.000245138, -0.025187) + float3 physics:diagonalInertia = (0.000024283923, 0.000043373493, 0.000037722883) + float physics:mass = 0.087 + quatf physics:principalAxes = (0.96742505, 0.008077622, -0.25280195, 0.010714625) + quatd xformOp:orient = (0.5000019669532776, -0.49999964237213135, -0.5000036358833313, -0.4999951124191284) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02061525173485279, -0.2774733006954193, 0.2668520510196686) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + token visibility = "inherited" + + def Xform "camera_mount" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (6.123233995736766e-17, 8.197998546692573e-18, -0.7071067811865475, -0.7071067811865476) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0039141791838348955, 0.025696293891666135, -0.029035789536837282) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "Cone" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cone" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "bolts" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_012" + quatd xformOp:orient = (0.6748477106, 0.2111477147, 0.2111537505, -0.6748416879) + double3 xformOp:scale = (1.000000119, 1, 1.000000119) + double3 xformOp:translate = (-0.001526863431, -0.01558837295, 0.0365398787) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "pcb" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cube_004" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rings" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_021" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "transistors" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cube_009" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "mount" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "mesh.001" + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (0.001000000047, 0.001000000047, 0.001000000047) + double3 xformOp:translate = (-0.0237439964, -0.02748438716, -0.001716122031) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "camera_cover" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_019" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "lens" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Sphere" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "focus" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_023" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "socket" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cube_010" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Camera "wowrobo_2MP_camera" ( + apiSchemas = ["OmniRtxCameraAutoExposureAPI_1", "OmniRtxCameraExposureAPI_1", "OmniLensDistortionOpenCvPinholeAPI"] + ) + { + float2 clippingRange = (0.001, 10000000) + float exposure:fStop = 5 + float exposure:responsivity = 1.1026709 + float exposure:time = 0.02 + float focalLength = 13.6 + float focusDistance = 400 + float omni:lensdistortion:opencvPinhole:cx = 323.5581 + float omni:lensdistortion:opencvPinhole:cy = 250.2736 + float omni:lensdistortion:opencvPinhole:fx = 339.26593 + float omni:lensdistortion:opencvPinhole:fy = 338.8201 + int2 omni:lensdistortion:opencvPinhole:imageSize = (640, 480) + float omni:lensdistortion:opencvPinhole:k1 = 0.07702322 + float omni:lensdistortion:opencvPinhole:k2 = -0.13605453 + float omni:lensdistortion:opencvPinhole:k3 = 0.05163219 + float omni:lensdistortion:opencvPinhole:p1 = -0.00024938 + float omni:lensdistortion:opencvPinhole:p2 = -0.00175006 + token visibility = "inherited" + quatd xformOp:orient = (0.953716950748227, -0.3007057995042728, 2.7729578989172417e-16, -2.6994024602707753e-16) + double3 xformOp:scale = (0.009999999776482582, 0.009999999776482582, 0.009999999776482582) + double3 xformOp:translate = (-0.0018862803672875517, 0.05226449046420151, -0.05853182757774217) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "collisions" ( + apiSchemas = None + instanceable = false + ) + { + rel collection:collisionmeshes:includes = + token visibility = "inherited" + + def Xform "camera_mount" + { + uniform token purpose = "guide" + token visibility = "invisible" + quatd xformOp:orient = (6.123233995736766e-17, 8.197998546692573e-18, -0.7071067811865475, -0.7071067811865476) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0039141791838348955, 0.025696293891666135, -0.029035789536837282) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "Cube" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + } + + def Xform "Cylinder" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..4c638c26fd139bfd8dd32d32200500b52b49e4b0 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40da4f4dea87771f6c0cdaeb71cf343cacb06ebd032f04339474a50499fb90e8 +size 4523559 diff --git a/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/instances.usda b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..f05e2992555f6508480f65dd9921519846fb7fde --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/instances.usda @@ -0,0 +1,161 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "Cone" ( + prepend references = @./geometries.usd@ + ) + { + over "Cone" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cone" + } + } + + def Xform "Cylinder_012" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_012" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_012" + } + } + + def Xform "Cube_004" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_004" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cube_004" + } + } + + def Xform "Cylinder_021" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_021" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_021" + } + } + + def Xform "Cube_009" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_009" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cube_009" + } + } + + def Xform "mesh_001" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_001" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "mesh.001" + } + } + + def Xform "Cylinder_019" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_019" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_019" + } + } + + def Xform "Sphere" ( + prepend references = @./geometries.usd@ + ) + { + over "Sphere" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Sphere" + } + } + + def Xform "Cylinder_023" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_023" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_023" + } + } + + def Xform "Cube_010" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_010" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cube_010" + } + } + + def Xform "Cube" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube" + } + } + + def Xform "Cylinder" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cylinder" + } + } +} + diff --git a/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/materials.usda b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..36d4b9d6ed4f2c394c65a5b545b0a9085fa0ec08 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/so101-camera_mount/payloads/materials.usda @@ -0,0 +1,251 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "material_a_3d_printed" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 0.82, 0.12) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.1, 0.1, 0.1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "PCB" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.16862702, 0.31724137, 0.057613954) + float inputs:reflection_roughness_constant = 0.58 + float inputs:specular_level = 0.39 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.033725403, 0.06344827, 0.01152279) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Lens" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.000001, 9.9999e-7, 9.9999e-7) + float inputs:reflection_roughness_constant = 0.08 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (2e-7, 1.99998e-7, 1.99998e-7) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.08 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Silver" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.93793106, 0.93792164, 0.93792164) + float inputs:metallic_constant = 1 + float inputs:reflection_roughness_constant = 0.5 + float inputs:specular_level = 1 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.18758622, 0.18758433, 0.18758433) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } +} + diff --git a/robotstudio_so101_new_calib/payloads/so101-camera_mount/source_assets/OmniPBR.mdl b/robotstudio_so101_new_calib/payloads/so101-camera_mount/source_assets/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/robotstudio_so101_new_calib/payloads/so101-camera_mount/source_assets/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_so101_new_calib/runnables/physics/mujoco.usda b/robotstudio_so101_new_calib/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..20e07cce71f38cf2839e86f390503931a1268ab4 --- /dev/null +++ b/robotstudio_so101_new_calib/runnables/physics/mujoco.usda @@ -0,0 +1,485 @@ +#usda 1.0 +( + defaultPrim = "so101_new_calib" +) + +def "so101_new_calib" +{ + over "base" + { + over "collisions" + { + over "base_motor_holder_so101_v1" + { + over "mesh" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "base_so101_v2" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "waveshare_mounting_plate_so101_v2" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_base_v1" + { + over "mesh_4" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "rotation_pitch_so101_v1" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "upper_arm_so101_v1" + { + over "mesh_6" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "under_arm_so101_v1" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_wrist_v1" + { + over "mesh_8" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_pitch_so101_v2" + { + over "mesh_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" + { + over "Cube_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_13" + { + over "Cube_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_09" + { + over "Cube_09" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_013" + { + over "Cube_013" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_12" + { + over "Cube_12" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_10" + { + over "Cube_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_02" + { + over "Cube_02" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_06" + { + over "Cube_06" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_03" + { + over "Cube_03" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_07" + { + over "Cube_07" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_007" + { + over "Cube_007" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_04" + { + over "Cube_04" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "shoulder_lift" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "elbow_flex" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "wrist_flex" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "wrist_roll" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "gripper" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_so101_new_calib_joints_shoulder_pan" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -17.724521896196094, -0.007089808895882634] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 10 + double mjc:forceRange:min = -10 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_shoulder_lift" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -150.22124083153616, -0.060088495841694615] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 10 + double mjc:forceRange:min = -10 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_elbow_flex" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -302.85982221412326, -0.12114393035840883] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 10 + double mjc:forceRange:min = -10 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_wrist_flex" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -275.05488708418835, -0.11002194780071493] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 10 + double mjc:forceRange:min = -10 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_wrist_roll" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -43.13132638212071, -0.017252530905029914] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 10 + double mjc:forceRange:min = -10 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_gripper" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -2.1667360012046792, -0.0008666943723006712] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 10 + double mjc:forceRange:min = -10 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } +} + diff --git a/robotstudio_so101_new_calib/runnables/physics/newton.usda b/robotstudio_so101_new_calib/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..8c7ef96bb85ea1f81329a59acaf07df6dac8c798 --- /dev/null +++ b/robotstudio_so101_new_calib/runnables/physics/newton.usda @@ -0,0 +1,429 @@ +#usda 1.0 +( + defaultPrim = "so101_new_calib" +) + +over "so101_new_calib" +{ + over "base" + { + over "collisions" + { + over "base_motor_holder_so101_v1" + { + over "mesh" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "base_so101_v2" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "waveshare_mounting_plate_so101_v2" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_base_v1" + { + over "mesh_4" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "rotation_pitch_so101_v1" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "upper_arm_so101_v1" + { + over "mesh_6" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "under_arm_so101_v1" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_wrist_v1" + { + over "mesh_8" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_pitch_so101_v2" + { + over "mesh_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" + { + over "Cube_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_13" + { + over "Cube_13" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_09" + { + over "Cube_09" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_013" + { + over "Cube_013" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_12" + { + over "Cube_12" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_10" + { + over "Cube_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_02" + { + over "Cube_02" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_06" + { + over "Cube_06" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_03" + { + over "Cube_03" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_07" + { + over "Cube_07" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_007" + { + over "Cube_007" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_04" + { + over "Cube_04" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.2193 + float newton:damping = 0.007309 + float newton:velocityLimit = 572.95776 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 3.5 + float newton:damping = 0.007309 + float newton:velocityLimit = 572.95776 + } + + over "elbow_flex" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 3 + float newton:damping = 0.007309 + float newton:velocityLimit = 572.95776 + } + + over "wrist_flex" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.2193 + float newton:damping = 0.007309 + float newton:velocityLimit = 572.95776 + } + + over "wrist_roll" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.2193 + float newton:damping = 0.007309 + float newton:velocityLimit = 572.95776 + } + + over "gripper" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.2193 + float newton:damping = 0.007309 + float newton:velocityLimit = 572.95776 + } + } +} + diff --git a/robotstudio_so101_new_calib/runnables/physics/physx.usda b/robotstudio_so101_new_calib/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..6f03253a04a132a7b0a5156eeed8a26b6dd3c8cb --- /dev/null +++ b/robotstudio_so101_new_calib/runnables/physics/physx.usda @@ -0,0 +1,399 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "elbow_flex" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "wrist_flex" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "wrist_roll" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + + over "gripper" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 572.95776 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 1 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "gripper" + { + over "collisions" ( + ) + { + uniform token physics:approximation = "sdf" + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" + { + over "Cube_11" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_13" + { + over "Cube_13" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_09" + { + over "Cube_09" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_013" + { + over "Cube_013" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_12" + { + over "Cube_12" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_10" + { + over "Cube_10" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "base" + { + over "collisions" + { + over "base_motor_holder_so101_v1" + { + over "mesh" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "base_so101_v2" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "waveshare_mounting_plate_so101_v2" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "motor_holder_so101_base_v1" + { + over "mesh_4" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "rotation_pitch_so101_v1" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "upper_arm_so101_v1" + { + over "mesh_6" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "under_arm_so101_v1" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "motor_holder_so101_wrist_v1" + { + over "mesh_8" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + + over "wrist_roll_pitch_so101_v2" + { + over "mesh_10" ( + ) + { + token physics:approximation = "convexDecomposition" + } + } + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_02" + { + over "Cube_02" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_06" + { + over "Cube_06" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_03" + { + over "Cube_03" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_07" + { + over "Cube_07" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_007" + { + over "Cube_007" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_04" + { + over "Cube_04" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/robotstudio_so101_new_calib/so101_new_calib.usda b/robotstudio_so101_new_calib/so101_new_calib.usda new file mode 100644 index 0000000000000000000000000000000000000000..0313df3e00158cd29b4cb9dbc30777c7d4e6ecb1 --- /dev/null +++ b/robotstudio_so101_new_calib/so101_new_calib.usda @@ -0,0 +1,460 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/so101_new_calib" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/so101_new_calib" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/so101_new_calib" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.110925, 0.42961726, 0.26717088) + string asset_license = "Apache-2.0" + string asset_name = "so101_new_calib" + string asset_type = "robot" + string author = "RobotStudio" + string category = "robotic arm" + double mass = 0.6320060025900602 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "RobotStudio/so101_new_calib/so101_new_calib.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Robot = "none" + } + variantSets = ["Robot", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "base" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "shoulder" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "upper_arm" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "lower_arm" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "wrist" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "gripper" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" + { + token visibility = "invisible" + } + } + + over "Cube_02" + { + over "Cube_02" + { + token visibility = "invisible" + } + } + + over "Cube_06" + { + over "Cube_06" + { + token visibility = "invisible" + } + } + + over "Cube_03" + { + over "Cube_03" + { + token visibility = "invisible" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" + { + token visibility = "invisible" + } + } + + over "Cube_07" + { + over "Cube_07" + { + token visibility = "invisible" + } + } + + over "Cube_007" + { + over "Cube_007" + { + token visibility = "invisible" + } + } + + over "Cube_04" + { + over "Cube_04" + { + token visibility = "invisible" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" + { + token visibility = "invisible" + } + } + } + } + variantSet "Robot" = { + "none" ( + prepend payload = @./payloads/Robot/none.usda@ + ) { + + } + "robot" ( + prepend payload = @./payloads/Robot/robot.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..625204b651a7afee7136aa069eaa2b1116d3516b --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:30", + "assets": [ + { + "asset": "so101_new_calib.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.packaging.bom.json b/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..6ebf7ae4c36e14e9d558afe37f67882b7aeb3a2f --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,279 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7841, + "hash": { + "sha256-flat-1mb": "b6a99fe0a1258ff8a29f736b6ebeb9fbb7f1684d55ff1d80ff62073c2a8f5fcf", + "sha256": "1222a1f254a904edf396d5ba3cf731c82a5c9511af4fc8af5401bd9e52b02e77" + } + }, + { + "relative_path": ".thumbs/256x256/.so101_new_calib.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "ad399b0f252a3421f48f1d521da0fae14a3f32d46b863b7ec7543233f16c3b06", + "sha256": "5f7c0b4c14ecde6a1f5b0f86d19681a8c387dcaf352934a89d0ae842a4131a67" + } + }, + { + "relative_path": ".thumbs/256x256/so101_new_calib.usda.png", + "size": 48104, + "hash": { + "sha256-flat-1mb": "050ff5d66f0afbfc743ba71bc66f9ec3179b9924c24a0815d26b2aeafa9d683a", + "sha256": "1971a86735cf1aee75d586988ef5130d1e3b1fa77155b905ac7b4e575bbfe44d" + } + }, + { + "relative_path": ".thumbs/so101_new_calib.thumb.usd", + "size": 6132, + "hash": { + "sha256-flat-1mb": "d42b0596be6f85fc233a907b88ef25e048bde17eb10253bf573835e2fdf5ca73", + "sha256": "a5adf966ab37ce0f81e0c4147da900ace70bce4eff959304b25719dfd2e4535a" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 4572, + "hash": { + "sha256-flat-1mb": "4c95f72842ed0c5b82d0398178071ca34da7bf61318b4cf4de9fdcc20f2333d4", + "sha256": "e5491a7b9ce9e43cfa2d12ec0b300e2b636e07c65eb69fea2a337a9c2b16e616" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "1ab9760654ab710763793529bc6243eed9987ab3b3b0a3ab0bf0fb8855f5bbb2", + "sha256": "cda14b6bd38510a9337bc5a224af6ca474b4a1a328b980af413f5794ee692385" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 20378, + "hash": { + "sha256-flat-1mb": "0954652999e44c696208bd241cd6f09fe03be6434a90f6f825cc742f7e131af7", + "sha256": "2ddb2f1e7bbfef42a91db814bbdaff46fe6405c4c06a211f3d263032490657eb" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1516, + "hash": { + "sha256-flat-1mb": "c8ab9e9c3af13c1181f4cf5873aa2ad948fd39a072b022d581a4c5fda5028673", + "sha256": "8ed64c5a7b606b7a62fbf657145205aec7e445f8cbd9bec67ff6250500ef79a4" + } + }, + { + "relative_path": "payloads/Robot/none.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "1ab9760654ab710763793529bc6243eed9987ab3b3b0a3ab0bf0fb8855f5bbb2", + "sha256": "cda14b6bd38510a9337bc5a224af6ca474b4a1a328b980af413f5794ee692385" + } + }, + { + "relative_path": "payloads/Robot/robot.usda", + "size": 5103, + "hash": { + "sha256-flat-1mb": "562fbf66534b019a1bfd65325e7397aea708c559a2b939ae8b0100d7b8fc4b0e", + "sha256": "30a8b9f599b28713adb6807f8328dc12edfdb7441f71fd4997c0ed6ba64eafda" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "1ab9760654ab710763793529bc6243eed9987ab3b3b0a3ab0bf0fb8855f5bbb2", + "sha256": "cda14b6bd38510a9337bc5a224af6ca474b4a1a328b980af413f5794ee692385" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 231, + "hash": { + "sha256-flat-1mb": "a52872a73878ddee40ae5a7f4b68c1fddb83299392b29bb8ba69719947c9da53", + "sha256": "24305dd2f85b0868a336825ece5beb987a804afe6aacbf25078c955164d3e7b6" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 40721, + "hash": { + "sha256-flat-1mb": "e8fb55ab902249168666618e24cc01766ba71710952fd9f0d9457df1e6fd3073", + "sha256": "139ae47c4cb9c5ccb9e60621a9a2766e4b65aa6f31cfd7b8036f5ee5512b21ce" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 23256984, + "hash": { + "sha256-flat-1mb": "e70637613e77415ccfe5f3d9bc81551aa26adb3510903c943aa941f78f94a0b0", + "sha256": "6c74f18b3c3d52c4426160b333f58a98b310db1fb6d85fe4516353e1bafc9091", + "sha256-first1m": "184d7aca77e0bd7ab61070b5b8cd7f11a92b0e39b63da5030a40c9a9d82286c5" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 44013, + "hash": { + "sha256-flat-1mb": "1d7ea57614db40c9bc5670a8523f03aa4f958e7308692038b212121d26c28a36", + "sha256": "bd2d5fca5fe3a394593d52bf5cc47b7871cc8796b37e00ce02e76d5f49345077" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 9097, + "hash": { + "sha256-flat-1mb": "ce9d6e5e6170805232a7e3199abf8f7391794b9f2898583bff94236f3cc1b65d", + "sha256": "7fd5222ad5717fcd6e03dbe8f8e0007e00e5ad0a33cfc9cdf0144e28b13fbe55" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 5772, + "hash": { + "sha256-flat-1mb": "8ce6fe098180f6c99f7bdcc321a09c09176c37965672530d734ec161abfb3084", + "sha256": "a8200f56de5b9552e89324821eac9d7f701fe9f9f1bb0b20b5b3931ab02e4d2e" + } + }, + { + "relative_path": "payloads/so101-camera_mount/SO-101_camera_mount.usda", + "size": 281, + "hash": { + "sha256-flat-1mb": "825a2fc72e2060e7af1245a420b304f770ec24bc6ecae8cd70f07a0e53ddbefc", + "sha256": "0f5bdea7c8b44183bf60341af648f3dc74feae82b1f681e610433f7fa8b4b608" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/base.usda", + "size": 18528, + "hash": { + "sha256-flat-1mb": "34a24f5d86780a89ecfc6f0c23d52985f2fb6f9ba180f0693aca58f1baab1018", + "sha256": "6ffa11a8f23182eaf38605ef22891be6ce308341216bcfcaff99fa2191db588f" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/geometries.usd", + "size": 4523559, + "hash": { + "sha256-flat-1mb": "ff54db8c572ea09fde3b93e6abbb83312e34f38e905174ebba8f0b32fcf5200d", + "sha256": "40da4f4dea87771f6c0cdaeb71cf343cacb06ebd032f04339474a50499fb90e8", + "sha256-first1m": "0f29eae94c6fa8c5431c45d5c2a04df0b760ebbfde905f543a0cef8ec2f5c441" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/instances.usda", + "size": 3888, + "hash": { + "sha256-flat-1mb": "66947ced94f505d29d7df468989da3f7f23c36ae817e92e1733619e4fd24911a", + "sha256": "b2a3cb9a2e20986012a855c49b1f1da61e7a0fef224282bf1b54e02fbdc74c4b" + } + }, + { + "relative_path": "payloads/so101-camera_mount/payloads/materials.usda", + "size": 8667, + "hash": { + "sha256-flat-1mb": "9ba909d924659a1bde27af3b83c13847ad09ebfe4fec556360af7eac9e845277", + "sha256": "b645538c88a57ea1f384fcf99ad9a9bf819c6e02ac6273010611ddf4af54b784" + } + }, + { + "relative_path": "payloads/so101-camera_mount/source_assets/OmniPBR.mdl", + "size": 13989, + "hash": { + "sha256-flat-1mb": "4d0f54d47017bfbe22cc483cb02c4fe7e2254ddd1119cd618cbaea553639d52c", + "sha256": "d384fc800f120e3cad1b7ca8837f9c554f9c34343d194813fca27caa493001f2" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 16590, + "hash": { + "sha256-flat-1mb": "b3c9540cfddbd6612ddd018ee61fdb4e03181e11e6a9067bbaf4cbf1f987e3f5", + "sha256": "255568b366a1793528102e1a58cb9786555bb5847ea0c18df64544dc14b2a957" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 13125, + "hash": { + "sha256-flat-1mb": "d61121d93d042c898fd50d6a56181568d537794c36ee8d9bcf1a7325907e3330", + "sha256": "0ef123f6f4abd6fefe8460831e6df7b13718d702340d8af3fdc2fbfac71e2433" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 12065, + "hash": { + "sha256-flat-1mb": "7f2120d4dc90f3e13669dba1125048e3a04f11482bf8951e394ee46f2042272e", + "sha256": "0190ddb660f8ba30358db61ac0b8bf348d0b1183482dfa485063abaaef5e144f" + } + }, + { + "relative_path": "so101_new_calib.usda", + "size": 17248, + "hash": { + "sha256-flat-1mb": "8b70f8ada06305a82dd43cc4e62340e0e42f57b40367c4ebf03d5a2d5ab1b1cf", + "sha256": "1c9809cfc0e236d673a299292acea5a9ae31bd49152664d7326063b31788713f" + } + } + ] +} \ No newline at end of file diff --git a/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.root_usds.json b/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..1c2c69d3f2fc815a9c5d9a0d9979e6f745409cf8 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "so101_new_calib.usda" + ] +} diff --git a/robotstudio_sysid_so101_new_calib/.metadata/license.txt b/robotstudio_sysid_so101_new_calib/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.metadata/license.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/robotstudio_sysid_so101_new_calib/.simready/validation.json b/robotstudio_sysid_so101_new_calib/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..a33c73454356f791f9a1374d0bba5b5f8146d3ac --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.simready/validation.json @@ -0,0 +1,226 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.BIND.002']", + "passed": false, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.BIND.002', 'com.nvidia.simready.VM.PBR.001', 'com.nvidia.simready.VM.PBR.003']", + "passed": false, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/robotstudio_sysid_so101_new_calib/.thumbs/256x256/.so101_new_calib.usda.last_generated b/robotstudio_sysid_so101_new_calib/.thumbs/256x256/.so101_new_calib.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..357658f6a5fbf99a4296350d34f9342069dad9f4 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.thumbs/256x256/.so101_new_calib.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:41:02 \ No newline at end of file diff --git a/robotstudio_sysid_so101_new_calib/.thumbs/256x256/so101_new_calib.usda.png b/robotstudio_sysid_so101_new_calib/.thumbs/256x256/so101_new_calib.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..b49fea8639a05b362b58cd1d4f389215406d775d --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/.thumbs/256x256/so101_new_calib.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1971a86735cf1aee75d586988ef5130d1e3b1fa77155b905ac7b4e575bbfe44d +size 48104 diff --git a/robotstudio_sysid_so101_new_calib/.thumbs/so101_new_calib.thumb.usd b/robotstudio_sysid_so101_new_calib/.thumbs/so101_new_calib.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..84d9ba9dfa52a1182c8715b31aef9ac4e1863007 Binary files /dev/null and b/robotstudio_sysid_so101_new_calib/.thumbs/so101_new_calib.thumb.usd differ diff --git a/robotstudio_sysid_so101_new_calib/com.nvidia.simready.packaging.json b/robotstudio_sysid_so101_new_calib/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..5dc2b86071b49b49cc97e506e5ca740a46cd7bcb --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "robotstudio_sysid_so101_new_calib.1.0.0", + "license": "Apache-2.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "a4fe50bd14ba6b4470e0faea63c85d6f1aa250af81d7d6204067576188fa04ae" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "69c2f12dec76abae2325476054f8e797f572731e98facc1a9cb45c1bf4fbbb4e" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "00616225482a092cace64f0a12042d9f1921d2958503f2d146d18c3e6ad3e2ef" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + } + } + ], + "content_hash": { + "sha256": "1fddc173993888b1ef3e126dd090ade127be4c0e1b3fe29c6dc5bb6119a9143d" + }, + "package_hash": { + "sha256": "4495ebf14ab9132109997de9a1cc8cbc5c3c24a8c2a2315b9259fc33033f8ba1" + } +} diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/LICENSE.md b/robotstudio_sysid_so101_new_calib/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBR.mdl b/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBRBase.mdl b/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBR_ClearCoat.mdl b/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/aux_definitions.mdl b/robotstudio_sysid_so101_new_calib/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/core_definitions.mdl b/robotstudio_sysid_so101_new_calib/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/robotstudio_sysid_so101_new_calib/materials/mdl/support_definitions.mdl b/robotstudio_sysid_so101_new_calib/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/robotstudio_sysid_so101_new_calib/payloads/Physics/mujoco.usda b/robotstudio_sysid_so101_new_calib/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..0acc9bf4a232edda91b11df06afd0e8ed82a5ae6 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Physics/mujoco.usda @@ -0,0 +1,276 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" +{ + over "base" + { + over "baseframe" + { + } + + over "visuals" + { + over "base_motor_holder_so101_v1" + { + } + + over "base_so101_v2" + { + } + + over "sts3215_03a_v1" + { + } + + over "waveshare_mounting_plate_so101_v2" + { + } + } + + over "collisions" + { + over "base_motor_holder_so101_v1" + { + } + + over "base_so101_v2" + { + } + + over "sts3215_03a_v1" + { + } + + over "waveshare_mounting_plate_so101_v2" + { + } + } + } + + over "shoulder" + { + over "visuals" + { + over "sts3215_03a_v1" + { + } + + over "motor_holder_so101_base_v1" + { + } + + over "rotation_pitch_so101_v1" + { + } + } + + over "collisions" + { + over "sts3215_03a_v1" + { + } + + over "motor_holder_so101_base_v1" + { + } + + over "rotation_pitch_so101_v1" + { + } + } + } + + over "joints" + { + over "shoulder_pan" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "shoulder_lift" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "elbow_flex" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "wrist_flex" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "wrist_roll" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "gripper" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "upper_arm" + { + over "visuals" + { + over "sts3215_03a_v1" + { + } + + over "upper_arm_so101_v1" + { + } + } + + over "collisions" + { + over "sts3215_03a_v1" + { + } + + over "upper_arm_so101_v1" + { + } + } + } + + over "lower_arm" + { + over "visuals" + { + over "under_arm_so101_v1" + { + } + + over "motor_holder_so101_wrist_v1" + { + } + + over "sts3215_03a_v1" + { + } + } + + over "collisions" + { + over "under_arm_so101_v1" + { + } + + over "motor_holder_so101_wrist_v1" + { + } + + over "sts3215_03a_v1" + { + } + } + } + + over "wrist" + { + over "visuals" + { + over "sts3215_03a_no_horn_v1" + { + } + + over "wrist_roll_pitch_so101_v2" + { + } + } + + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + } + + over "wrist_roll_pitch_so101_v2" + { + } + } + } + + over "gripper" + { + over "gripperframe" + { + } + + over "visuals" + { + over "sts3215_03a_v1" + { + } + + over "wrist_roll_follower_so101_v1" + { + } + } + + over "collisions" + { + over "sts3215_03a_v1" + { + } + + over "wrist_roll_follower_so101_v1" + { + } + } + } + + over "moving_jaw_so101_v1" + { + over "visuals" + { + over "moving_jaw_so101_v1" + { + } + } + + over "collisions" + { + over "moving_jaw_so101_v1" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + over "material_a_d_printed" + { + } + + over "material_sts3215" + { + } + } + + over "VisualMaterials" + { + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Physics/none.usda b/robotstudio_sysid_so101_new_calib/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c141bd0fdeb0d3a2bb061287f669b5c4029021ba --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so101_new_calib" +{ +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Physics/physics.usda b/robotstudio_sysid_so101_new_calib/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..5b00dbb47e8dd2942009f4848e71d2a65f719aeb --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Physics/physics.usda @@ -0,0 +1,599 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" +{ + over "base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.020739, 0.0020428703, 0.065966) + float3 physics:diagonalInertia = (0.00013612688, 0.00011323285, 0.00013180728) + float physics:mass = 0.147 + quatf physics:principalAxes = (0.98998284, 0.14075965, 0.0025164415, 0.010700988) + + over "collisions" + { + over "base_motor_holder_so101_v1" ( + instanceable = false + ) + { + over "mesh" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "base_so101_v2" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "waveshare_mounting_plate_so101_v2" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "shoulder" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0307604, -0.0000166727, -0.0252713) + float3 physics:diagonalInertia = (0.00008378355, 0.00008103881, 0.00002395524) + float physics:mass = 0.100006 + quatf physics:principalAxes = (0.9998646, 0.0014956784, 0.009708396, 0.013204301) + + over "collisions" + { + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "motor_holder_so101_base_v1" ( + instanceable = false + ) + { + over "mesh_4" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "rotation_pitch_so101_v1" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "joints" + { + def PhysicsRevoluteJoint "shoulder_pan" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.058199663 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.84508663 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00049496203 + point3f physics:localPos0 = (0.0207909, -0.0230745, 0.0948817) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (8.963205e-7, -0.7071055, -0.7071081, 8.9632374e-7) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -109.99987 + float physics:upperLimit = 109.99987 + } + + def PhysicsRevoluteJoint "shoulder_lift" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.04473567 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.8339643 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0041949684 + point3f physics:localPos0 = (-0.0303992, -0.0182778, -0.0542) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.4999982, -0.5, -0.5, -0.50000185) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -100.00004 + float physics:upperLimit = 100.00004 + } + + def PhysicsRevoluteJoint "elbow_flex" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.005990843 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.25683385 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.008457442 + point3f physics:localPos0 = (-0.11257, -0.028, 2.46331e-16) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -6.378481e-16, -2.3060708e-16, 0.7071081) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -96.829865 + float physics:upperLimit = 96.829865 + } + + def PhysicsRevoluteJoint "wrist_flex" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.07224342 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.7610886 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.007680981 + point3f physics:localPos0 = (-0.1349, 0.0052, 1.65232e-16) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 2.1600662e-15, -1.3619623e-16, -0.7071081) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -94.99983 + float physics:upperLimit = 94.99983 + } + + def PhysicsRevoluteJoint "wrist_roll" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.051808216 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 0.95773053 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0012044539 + point3f physics:localPos0 = (0, -0.0611, 0.0181) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (8.631542e-7, 9.2948994e-7, 0.7071081, 0.7071055) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -157.21101 + float physics:upperLimit = 162.78932 + } + + def PhysicsRevoluteJoint "gripper" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.04919612 + float drive:angular:physics:maxForce = 3.35 + float drive:angular:physics:stiffness = 1.1912011 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00006050668 + point3f physics:localPos0 = (0.0202, 0.0188, -0.0234) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, -4.92038e-15, -4.8840093e-15) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -10.000004 + float physics:upperLimit = 100.00004 + } + } + + over "upper_arm" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0898471, -0.00838224, 0.0184089) + float3 physics:diagonalInertia = (0.000037245056, 0.00015087317, 0.000142487) + float physics:mass = 0.103 + quatf physics:principalAxes = (0.9960497, 0.0009638968, -0.00009570287, 0.08879216) + + over "collisions" + { + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "upper_arm_so101_v1" ( + instanceable = false + ) + { + over "mesh_6" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "lower_arm" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0980701, 0.00324376, 0.0182831) + float3 physics:diagonalInertia = (0.00002831246, 0.00016026171, 0.00014530364) + float physics:mass = 0.104 + quatf physics:principalAxes = (0.999589, 0.00089328334, 0.0053831167, -0.028146055) + + over "collisions" + { + over "under_arm_so101_v1" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "motor_holder_so101_wrist_v1" ( + instanceable = false + ) + { + over "mesh_8" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "wrist" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.000103312, -0.0386143, 0.0281156) + float3 physics:diagonalInertia = (0.000036826477, 0.000027447379, 0.000018943445) + float physics:mass = 0.079 + quatf physics:principalAxes = (0.9671435, 0.2542262, 0.0016222623, -0.00014630717) + + over "collisions" + { + over "sts3215_03a_no_horn_v1" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "wrist_roll_pitch_so101_v2" ( + instanceable = false + ) + { + over "mesh_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "gripper" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00021362693, 0.000245138, -0.025187) + float3 physics:diagonalInertia = (0.000024283927, 0.000043373497, 0.000037722893) + float physics:mass = 0.087 + quatf physics:principalAxes = (0.96742505, 0.008077627, -0.252802, 0.010714627) + + over "collisions" + { + over "sts3215_03a_v1" ( + instanceable = false + ) + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" ( + instanceable = false + ) + { + over "Cube_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_13" ( + instanceable = false + ) + { + over "Cube_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_09" ( + instanceable = false + ) + { + over "Cube_09" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_013" ( + instanceable = false + ) + { + over "Cube_013" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_12" ( + instanceable = false + ) + { + over "Cube_12" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_10" ( + instanceable = false + ) + { + over "Cube_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + } + } + } + + over "moving_jaw_so101_v1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00157495, -0.0300244, 0.0192755) + float3 physics:diagonalInertia = (0.000006635825, 0.0000018652258, 0.00000529092) + float physics:mass = 0.012 + quatf physics:principalAxes = (0.99930465, 0.016051318, -0.0010975002, -0.033638127) + + over "collisions" + { + over "Cube_05" ( + instanceable = false + ) + { + over "Cube_05" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_02" ( + instanceable = false + ) + { + over "Cube_02" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_06" ( + instanceable = false + ) + { + over "Cube_06" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_03" ( + instanceable = false + ) + { + over "Cube_03" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cylinder_02" ( + instanceable = false + ) + { + over "Cylinder_02" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_07" ( + instanceable = false + ) + { + over "Cube_07" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_007" ( + instanceable = false + ) + { + over "Cube_007" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cube_04" ( + instanceable = false + ) + { + over "Cube_04" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + + over "Cylinder_01" ( + instanceable = false + ) + { + over "Cylinder_01" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Physics/physx.usda b/robotstudio_sysid_so101_new_calib/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..971ac8af8535bf5e5ca24d8d67440ffdbba094c9 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "so101_new_calib" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "elbow_flex" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "wrist_flex" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "wrist_roll" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "gripper" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 1 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Robot/none.usda b/robotstudio_sysid_so101_new_calib/payloads/Robot/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c141bd0fdeb0d3a2bb061287f669b5c4029021ba --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Robot/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so101_new_calib" +{ +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Robot/robot.usda b/robotstudio_sysid_so101_new_calib/payloads/Robot/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..8b7bb82fa451fdd68f606dff98da62b0d46cba0c --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Robot/robot.usda @@ -0,0 +1,182 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] + + over "base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "shoulder" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "shoulder_lift" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "elbow_flex" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_flex" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_roll" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "gripper" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + } + + over "upper_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "lower_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "wrist" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "gripper" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "moving_jaw_so101_v1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Sensor/none.usda b/robotstudio_sysid_so101_new_calib/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c141bd0fdeb0d3a2bb061287f669b5c4029021ba --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def "so101_new_calib" +{ +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/Sensor/sensors.usda b/robotstudio_sysid_so101_new_calib/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..5573b2bac99092adbe1e5b57811a54d36ef8313b --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/Sensor/sensors.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend references = @../so101-camera_mount/SO-101_camera_mount.usda@ +) +{ +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/base.usda b/robotstudio_sysid_so101_new_calib/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..b5faa90b22078f51145b64e879f9d80d4cf4426b --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/base.usda @@ -0,0 +1,904 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "so101_new_calib" +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "base" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "baseframe" + { + quatd xformOp:orient = (1, 1.3877799388343032e-17, -4.763979934278074e-30, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079099975526333, 0.01576079986989498, 0.03248170018196106) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "base_motor_holder_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02069149911, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "base_so101_v2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0, 0, -0.707108045) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, -0.01057450008, 0.07618170232) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "waveshare_mounting_plate_so101_v2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02059149928, 0.04674350098, 0.07988169789) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "base_motor_holder_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02069149911, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "base_so101_v2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, 0.02212549932, 0.03008170053) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0, 0, -0.707108045) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917, -0.01057450008, 0.07618170232) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "waveshare_mounting_plate_so101_v2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, 0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02059149928, 0.04674350098, 0.07988169789) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "shoulder" + { + quatd xformOp:orient = (8.963205004874908e-7, -0.7071055173873901, -0.7071080803871155, 8.963237405623659e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02079089917242527, -0.023074500262737274, 0.09488169848918915) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.03039919958, 0.0004222409916, -0.04170000181) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_base_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, -0.4999999801, 0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06759919971, -0.0001777589932, 0.0158498995) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rotation_pitch_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.01220079977, 0.00002224130003, 0.04639999941) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.03039919958, 0.0004222409916, -0.04170000181) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_base_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, -0.4999999801, 0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06759919971, -0.0001777589932, 0.0158498995) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rotation_pitch_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.01220079977, 0.00002224130003, 0.04639999941) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Scope "joints" + { + } + + def Xform "upper_arm" + { + quatd xformOp:orient = (-0.7071058750152588, 0.000003845626451948192, -0.7071077823638916, -0.0000012814998626708984) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0025133490562438965, -0.05347376689314842, 0.149081751704216) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (8.963205005e-7, -0.7071054997, 0.7071080627, -8.963237181e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1125700027, -0.01549999975, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "upper_arm_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06508500129, 0.0120000001, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (8.963205005e-7, -0.7071054997, 0.7071080627, -8.963237181e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1125700027, -0.01549999975, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "upper_arm_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06508500129, 0.0120000001, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "lower_arm" + { + quatd xformOp:orient = (-0.4999975860118866, -0.49999889731407166, -0.5000025629997253, -0.5000011920928955) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.00251384056173265, -0.08147336542606354, 0.261651873588562) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "under_arm_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_wrist_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01799999923) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0, 0.000001267590847, -1, 0.000001267590847) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1224000007, 0.005200000014, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "under_arm_so101_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01820000075) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "motor_holder_so101_wrist_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.06484989822, -0.03200000152, 0.01799999923) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0, 0.000001267590847, -1, 0.000001267590847) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.1224000007, 0.005200000014, 0.0186999999) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "wrist" + { + quatd xformOp:orient = (-0.7071059346199036, 0.000003874301910400391, -0.7071078419685364, -0.0000012516975402832031) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.002514801686629653, -0.21637339890003204, 0.26685187220573425) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_no_horn_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755e-17, -0.04239999875, 0.03060000017) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_pitch_so101_v2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, -0.4999999801, -0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.02800000086, 0.01810000092) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_no_horn_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, 0.4999999801, 0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755e-17, -0.04239999875, 0.03060000017) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_pitch_so101_v2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.4999982119, -0.4999999801, -0.4999999801, -0.5000018279) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.02800000086, 0.01810000092) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "gripper" + { + quatd xformOp:orient = (0.5000019669532776, -0.49999964237213135, -0.5000036358833313, -0.4999951124191284) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02061525173485279, -0.2774733006954193, 0.2668520510196686) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "gripperframe" + { + quatd xformOp:orient = (0.49999821186065674, 0.5, 0.500001847743988, 0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.007899999618530273, -0.0002181210002163425, -0.09812740236520767) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.007699999958, 0.00009999999747, -0.02339999937) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_follower_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.000001267590847, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755e-17, -0.0002182140015, 0.0009497060091) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "sts3215_03a_v1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + quatd xformOp:orient = (0.7071055174, -0.707108045, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.007699999958, 0.00009999999747, -0.02339999937) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "wrist_roll_follower_so101_v1" + { + uniform token purpose = "guide" + custom string userProperties:blender:object_name = "gripper_col" + token visibility = "invisible" + quatd xformOp:orient = (0.7071067811865476, 0, 0.7071067811865475, 0) + float3 xformOp:rotateXYZ = (0, -90, -180) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (5.551119755337213e-17, -0.000218214001506567, 0.0009497060091234744) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "Cube_11" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07446918052, 2.303949029e-9, -0.01855467064) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_13" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02389621895, -2.697642773e-18, -0.02202789289) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_09" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.09953665893, 2.071118385e-9, -0.0119890998) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_013" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0236068384, 2.769610316e-9, -0.007172210041) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_12" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05387327235, 2.071118385e-9, -0.02307547433) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_10" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.08926332157, 2.071118385e-9, -0.01510555846) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + } + } + } + + def Xform "moving_jaw_so101_v1" + { + string isaac:nameOverride ( + displayName = "Name Override" + ) + quatd xformOp:orient = (0.7071079611778259, 0.0000029206275939941406, -0.7071058750152588, 0.0000073015689849853516) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.03941557556390762, -0.3008729815483093, 0.2870521545410156) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "moving_jaw_so101_v1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-5.551119755e-17, -1.947459937e-17, 0.01889999956) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "Cube_05" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0006168186665000408, -0.036364406350000045, 0.018899998654279482) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_02" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.007896840572000074, -0.07659551501000006, 0.01889999888711012) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_06" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.00033348798749999187, -0.017924129960000035, 0.018899997257295624) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_03" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.004521667957000042, -0.06644535065000001, 0.01889999888711012) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cylinder_02" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.000362992286699948, 0.0005430579184999562, 0.03941918722892563) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_07" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0002458095550999517, -0.007311433553999991, -0.001999812201074383) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_007" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0002458095550999517, -0.007311433554000046, 0.03979982994892562) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cube_04" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0018609762190000545, -0.05629521608000004, 0.01889999865427948) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "Cylinder_01" ( + active = true + instanceable = true + delete references = @instances.usda@ + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (0.49999999999999994, -0.5000000000000001, 0.5000000000000001, -0.5) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.000362992286699948, 0.0005430579184999562, -0.0016191694910743792) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Scope "Looks" + { + def Material "material_a_d_printed" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/geometries.usd b/robotstudio_sysid_so101_new_calib/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..9aeef5cfc896cb8d79beb9f5e8bf865b3579f71e --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c74f18b3c3d52c4426160b333f58a98b310db1fb6d85fe4516353e1bafc9091 +size 23256984 diff --git a/robotstudio_sysid_so101_new_calib/payloads/instances.usda b/robotstudio_sysid_so101_new_calib/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..de41a4aa8ddd3d2be449c90ad75ab6437cd475d6 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/instances.usda @@ -0,0 +1,1315 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "Cube_11" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_11" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.010" + } + } + + def Xform "Cube_13" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_13" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.012" + } + } + + def Xform "Cube_09" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_09" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.008" + } + } + + def Xform "Cube_013" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_013" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.013" + } + } + + def Xform "Cube_12" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_12" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.011" + } + } + + def Xform "Cube_10" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_10" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.009" + } + } + + def Xform "Cube_05" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_05" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.004" + } + } + + def Xform "Cube_02" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_02" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.001" + } + } + + def Xform "Cube_06" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_06" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.005" + } + } + + def Xform "Cube_03" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_03" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.002" + } + } + + def Xform "Cylinder_02" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_02" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cylinder.001" + } + } + + def Xform "Cube_07" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_07" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.006" + } + } + + def Xform "Cube_007" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_007" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.007" + } + } + + def Xform "Cube_04" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cube_04" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube.003" + } + } + + def Xform "Cylinder_01" ( + delete references = @geometries.usd@ + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_01" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cylinder" + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/materials.usda b/robotstudio_sysid_so101_new_calib/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..4e8efe3d6a2fd464c592e22e34fd42cfe616d74b --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/materials.usda @@ -0,0 +1,259 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "DefaultMaterial" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_a_d_printed" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 0.82, 0.12) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.1, 0.1, 0.1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/robot.usda b/robotstudio_sysid_so101_new_calib/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..408a44df5d7b0b037efed16da98c418bd6d1c39f --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/robot.usda @@ -0,0 +1,204 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "baseframe" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "shoulder" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "shoulder_lift" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "elbow_flex" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_flex" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "wrist_roll" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + + over "gripper" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + int isaac:physics:index + float[] isaac:physics:JerkLimit + int isaac:physics:Rot_X:DofOffset + int isaac:physics:Rot_Y:DofOffset + int isaac:physics:Rot_Z:DofOffset + int isaac:physics:Tr_X:DofOffset + int isaac:physics:Tr_Y:DofOffset + int isaac:physics:Tr_Z:DofOffset + } + } + + over "upper_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "lower_arm" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "wrist" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "gripper" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "gripperframe" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "moving_jaw_so101_v1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/SO-101_camera_mount.usda b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/SO-101_camera_mount.usda new file mode 100644 index 0000000000000000000000000000000000000000..b48c2b224bb4d7bb91782fd4d6ff8447eb5199f4 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/SO-101_camera_mount.usda @@ -0,0 +1,18 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + prepend references = @./payloads/base.usda@ +) +{ +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/base.usda b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..aa71844080d1fcf8fb89210b3084c582c236c236 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/base.usda @@ -0,0 +1,412 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + doc = """Generated from Composed Stage of root layer /tmp/wowrobo_camera/payloads/base.usd +""" + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "so101_new_calib" +{ + token visibility = "inherited" + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + def Material "material_a_3d_printed" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "PCB" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.033725403, 0.06344827, 0.01152279) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Lens" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (2e-7, 1.99998e-7, 1.99998e-7) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.08 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Silver" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.18758622, 0.18758433, 0.18758433) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Xform "gripper" ( + apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000213627, 0.000245138, -0.025187) + float3 physics:diagonalInertia = (0.000024283923, 0.000043373493, 0.000037722883) + float physics:mass = 0.087 + quatf physics:principalAxes = (0.96742505, 0.008077622, -0.25280195, 0.010714625) + quatd xformOp:orient = (0.5000019669532776, -0.49999964237213135, -0.5000036358833313, -0.4999951124191284) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02061525173485279, -0.2774733006954193, 0.2668520510196686) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + token visibility = "inherited" + + def Xform "camera_mount" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (6.123233995736766e-17, 8.197998546692573e-18, -0.7071067811865475, -0.7071067811865476) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0039141791838348955, 0.025696293891666135, -0.029035789536837282) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "Cone" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cone" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "bolts" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_012" + quatd xformOp:orient = (0.6748477106, 0.2111477147, 0.2111537505, -0.6748416879) + double3 xformOp:scale = (1.000000119, 1, 1.000000119) + double3 xformOp:translate = (-0.001526863431, -0.01558837295, 0.0365398787) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "pcb" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cube_004" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "rings" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_021" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "transistors" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cube_009" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "mount" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + custom string userProperties:blender:object_name = "mesh.001" + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (0.001000000047, 0.001000000047, 0.001000000047) + double3 xformOp:translate = (-0.0237439964, -0.02748438716, -0.001716122031) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "camera_cover" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_019" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "lens" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Sphere" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "focus" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cylinder_023" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "socket" ( + apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + custom string userProperties:blender:object_name = "Cube_010" + quatd xformOp:orient = (0.7053652441, 0.04963031873, 0.04963547236, -0.7053602085) + double3 xformOp:scale = (0.9999999404, 1, 0.9999999404) + double3 xformOp:translate = (-0.00201039901, 0.005435943604, 0.005527608097) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Camera "wowrobo_2MP_camera" ( + apiSchemas = ["OmniRtxCameraAutoExposureAPI_1", "OmniRtxCameraExposureAPI_1", "OmniLensDistortionOpenCvPinholeAPI"] + ) + { + float2 clippingRange = (0.001, 10000000) + float exposure:fStop = 5 + float exposure:responsivity = 1.1026709 + float exposure:time = 0.02 + float focalLength = 13.6 + float focusDistance = 400 + float omni:lensdistortion:opencvPinhole:cx = 323.5581 + float omni:lensdistortion:opencvPinhole:cy = 250.2736 + float omni:lensdistortion:opencvPinhole:fx = 339.26593 + float omni:lensdistortion:opencvPinhole:fy = 338.8201 + int2 omni:lensdistortion:opencvPinhole:imageSize = (640, 480) + float omni:lensdistortion:opencvPinhole:k1 = 0.07702322 + float omni:lensdistortion:opencvPinhole:k2 = -0.13605453 + float omni:lensdistortion:opencvPinhole:k3 = 0.05163219 + float omni:lensdistortion:opencvPinhole:p1 = -0.00024938 + float omni:lensdistortion:opencvPinhole:p2 = -0.00175006 + token visibility = "inherited" + quatd xformOp:orient = (0.953716950748227, -0.3007057995042728, 2.7729578989172417e-16, -2.6994024602707753e-16) + double3 xformOp:scale = (0.009999999776482582, 0.009999999776482582, 0.009999999776482582) + double3 xformOp:translate = (-0.0018862803672875517, 0.05226449046420151, -0.05853182757774217) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "collisions" ( + apiSchemas = None + instanceable = false + ) + { + rel collection:collisionmeshes:includes = + token visibility = "inherited" + + def Xform "camera_mount" + { + uniform token purpose = "guide" + token visibility = "invisible" + quatd xformOp:orient = (6.123233995736766e-17, 8.197998546692573e-18, -0.7071067811865475, -0.7071067811865476) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0039141791838348955, 0.025696293891666135, -0.029035789536837282) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "Cube" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + } + + def Xform "Cylinder" ( + active = true + instanceable = true + prepend references = @./instances.usda@ + ) + { + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..4c638c26fd139bfd8dd32d32200500b52b49e4b0 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40da4f4dea87771f6c0cdaeb71cf343cacb06ebd032f04339474a50499fb90e8 +size 4523559 diff --git a/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/instances.usda b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..f05e2992555f6508480f65dd9921519846fb7fde --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/instances.usda @@ -0,0 +1,161 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "Cone" ( + prepend references = @./geometries.usd@ + ) + { + over "Cone" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cone" + } + } + + def Xform "Cylinder_012" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_012" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_012" + } + } + + def Xform "Cube_004" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_004" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cube_004" + } + } + + def Xform "Cylinder_021" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_021" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_021" + } + } + + def Xform "Cube_009" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_009" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cube_009" + } + } + + def Xform "mesh_001" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_001" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "mesh.001" + } + } + + def Xform "Cylinder_019" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_019" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_019" + } + } + + def Xform "Sphere" ( + prepend references = @./geometries.usd@ + ) + { + over "Sphere" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Sphere" + } + } + + def Xform "Cylinder_023" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder_023" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cylinder_023" + } + } + + def Xform "Cube_010" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube_010" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom string userProperties:blender:data_name = "Cube_010" + } + } + + def Xform "Cube" ( + prepend references = @./geometries.usd@ + ) + { + over "Cube" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + custom string userProperties:blender:data_name = "Cube" + } + } + + def Xform "Cylinder" ( + prepend references = @./geometries.usd@ + ) + { + over "Cylinder" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + bool physics:collisionEnabled = 1 + token purpose = "guide" + custom string userProperties:blender:data_name = "Cylinder" + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/materials.usda b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..36d4b9d6ed4f2c394c65a5b545b0a9085fa0ec08 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/payloads/materials.usda @@ -0,0 +1,251 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 1000000 + metersPerUnit = 1 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "material_a_3d_printed" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 0.82, 0.12) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 0.82, 0.12) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_sts3215" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.1, 0.1, 0.1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.1, 0.1, 0.1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "PCB" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.16862702, 0.31724137, 0.057613954) + float inputs:reflection_roughness_constant = 0.58 + float inputs:specular_level = 0.39 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.033725403, 0.06344827, 0.01152279) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Lens" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.000001, 9.9999e-7, 9.9999e-7) + float inputs:reflection_roughness_constant = 0.08 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (2e-7, 1.99998e-7, 1.99998e-7) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.08 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "Silver" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../../../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_tint = (0.93793106, 0.93792164, 0.93792164) + float inputs:metallic_constant = 1 + float inputs:reflection_roughness_constant = 0.5 + float inputs:specular_level = 1 + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.18758622, 0.18758433, 0.18758433) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/source_assets/OmniPBR.mdl b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/source_assets/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/payloads/so101-camera_mount/source_assets/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/robotstudio_sysid_so101_new_calib/runnables/physics/mujoco.usda b/robotstudio_sysid_so101_new_calib/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..be3c9b08e4e04a2f368ded783c87e7170b2db69a --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/runnables/physics/mujoco.usda @@ -0,0 +1,485 @@ +#usda 1.0 +( + defaultPrim = "so101_new_calib" +) + +def "so101_new_calib" +{ + over "base" + { + over "collisions" + { + over "base_motor_holder_so101_v1" + { + over "mesh" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "base_so101_v2" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "waveshare_mounting_plate_so101_v2" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_base_v1" + { + over "mesh_4" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "rotation_pitch_so101_v1" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "upper_arm_so101_v1" + { + over "mesh_6" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "under_arm_so101_v1" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_wrist_v1" + { + over "mesh_8" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_pitch_so101_v2" + { + over "mesh_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" + { + over "Cube_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_13" + { + over "Cube_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_09" + { + over "Cube_09" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_013" + { + over "Cube_013" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_12" + { + over "Cube_12" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_10" + { + over "Cube_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_02" + { + over "Cube_02" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_06" + { + over "Cube_06" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_03" + { + over "Cube_03" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_07" + { + over "Cube_07" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_007" + { + over "Cube_007" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_04" + { + over "Cube_04" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "shoulder_lift" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "elbow_flex" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "wrist_flex" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "wrist_roll" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "gripper" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_so101_new_calib_joints_shoulder_pan" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -48.41989746023198, -3.334595042665663] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 3.3499999046325684 + double mjc:forceRange:min = -3.3499999046325684 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_shoulder_lift" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -47.78263398048062, -2.5631650898306853] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 3.3499999046325684 + double mjc:forceRange:min = -3.3499999046325684 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_elbow_flex" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -14.715495717725316, -0.34325000948065365] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 3.3499999046325684 + double mjc:forceRange:min = -3.3499999046325684 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_wrist_flex" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -43.60716517102799, -4.139243193642175] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 3.3499999046325684 + double mjc:forceRange:min = -3.3499999046325684 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_wrist_roll" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -54.87391737680086, -2.9683921024379023] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 3.3499999046325684 + double mjc:forceRange:min = -3.3499999046325684 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_so101_new_calib_joints_gripper" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -68.25079505494665, -2.8187300645616404] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 3.3499999046325684 + double mjc:forceRange:min = -3.3499999046325684 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/runnables/physics/newton.usda b/robotstudio_sysid_so101_new_calib/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..01e526e0efb5dd2b7ab4a4355dd53a7975cd0491 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/runnables/physics/newton.usda @@ -0,0 +1,425 @@ +#usda 1.0 +( + defaultPrim = "so101_new_calib" +) + +over "so101_new_calib" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float newton:armature = 0.06762 + float newton:damping = 0.005847 + float newton:friction = 0.347432 + float newton:velocityLimit = 1718.8734 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:stiffness = 3.5 + float newton:armature = 0.027645 + float newton:damping = 0.009798715 + float newton:friction = 0.344793 + float newton:velocityLimit = 1718.8734 + } + + over "elbow_flex" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:stiffness = 3 + float newton:armature = 0.03772 + float newton:damping = 0.013903974 + float newton:friction = 0.41119 + float newton:velocityLimit = 1718.8734 + } + + over "wrist_flex" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float newton:armature = 0.050714 + float newton:damping = 0.018707678 + float newton:friction = 0.248233 + float newton:velocityLimit = 1718.8734 + } + + over "wrist_roll" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float newton:armature = 0.054898 + float newton:damping = 0.005847 + float newton:friction = 0.221761 + float newton:velocityLimit = 1718.8734 + } + + over "gripper" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float newton:armature = 0.077625 + float newton:damping = 0.016730115 + float newton:friction = 0.083458 + float newton:velocityLimit = 1718.8734 + } + } + + over "base" + { + over "collisions" + { + over "base_motor_holder_so101_v1" + { + over "mesh" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "base_so101_v2" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "waveshare_mounting_plate_so101_v2" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_base_v1" + { + over "mesh_4" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "rotation_pitch_so101_v1" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "upper_arm_so101_v1" + { + over "mesh_6" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "under_arm_so101_v1" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_wrist_v1" + { + over "mesh_8" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_pitch_so101_v2" + { + over "mesh_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "gripper" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" + { + over "Cube_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_13" + { + over "Cube_13" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_09" + { + over "Cube_09" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_013" + { + over "Cube_013" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_12" + { + over "Cube_12" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_10" + { + over "Cube_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_02" + { + over "Cube_02" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_06" + { + over "Cube_06" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_03" + { + over "Cube_03" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_07" + { + over "Cube_07" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_007" + { + over "Cube_007" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cube_04" + { + over "Cube_04" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } +} + diff --git a/robotstudio_sysid_so101_new_calib/runnables/physics/physx.usda b/robotstudio_sysid_so101_new_calib/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..aa60da8181b793a93498d1b638483ae477e4a116 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/runnables/physics/physx.usda @@ -0,0 +1,416 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +over "so101_new_calib" +{ + over "joints" + { + over "shoulder_pan" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "shoulder_lift" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + float drive:angular:physics:stiffness = 1.22 + } + + over "elbow_flex" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + float drive:angular:physics:stiffness = 0.8 + } + + over "wrist_flex" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "wrist_roll" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + + over "gripper" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 1718.8734 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 1 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "gripper" + { + over "collisions" ( + ) + { + uniform token physics:approximation = "sdf" + + over "wrist_roll_follower_so101_v1" + { + over "Cube_11" + { + over "Cube_11" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_13" + { + over "Cube_13" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_09" + { + over "Cube_09" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_013" + { + over "Cube_013" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_12" + { + over "Cube_12" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_10" + { + over "Cube_10" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "base" + { + over "collisions" + { + over "base_motor_holder_so101_v1" + { + over "mesh" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "base_so101_v2" + { + over "mesh_1" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "waveshare_mounting_plate_so101_v2" + { + over "mesh_3" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "shoulder" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_base_v1" + { + over "mesh_4" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "rotation_pitch_so101_v1" + { + over "mesh_5" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "upper_arm" + { + over "collisions" + { + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "upper_arm_so101_v1" + { + over "mesh_6" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "lower_arm" + { + over "collisions" + { + over "under_arm_so101_v1" + { + over "mesh_7" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "motor_holder_so101_wrist_v1" + { + over "mesh_8" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "sts3215_03a_v1" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "wrist" + { + over "collisions" + { + over "sts3215_03a_no_horn_v1" + { + over "mesh_9" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "wrist_roll_pitch_so101_v2" + { + over "mesh_10" ( + prepend apiSchemas = ["PhysxConvexHullCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_02" + { + over "Cube_02" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_06" + { + over "Cube_06" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_03" + { + over "Cube_03" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_07" + { + over "Cube_07" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_007" + { + over "Cube_007" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cube_04" + { + over "Cube_04" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" ( + prepend apiSchemas = ["PhysxCollisionAPI", "PhysxConvexHullCollisionAPI", "PhysxTriangleMeshCollisionAPI"] + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/robotstudio_sysid_so101_new_calib/so101_new_calib.usda b/robotstudio_sysid_so101_new_calib/so101_new_calib.usda new file mode 100644 index 0000000000000000000000000000000000000000..fab4a92488d3be3a5edee9ef45a37783086a5e95 --- /dev/null +++ b/robotstudio_sysid_so101_new_calib/so101_new_calib.usda @@ -0,0 +1,459 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/so101_new_calib" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/so101_new_calib" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/so101_new_calib" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.VM.BIND.002']" + bool passed = 0 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.VM.BIND.002', 'com.nvidia.simready.VM.PBR.001', 'com.nvidia.simready.VM.PBR.003']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.DISP.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.110925, 0.42961726, 0.26717088) + string asset_license = "Apache-2.0" + string asset_name = "so101_new_calib" + string asset_type = "robot" + string author = "RobotStudio" + string category = "robotic arm" + double mass = 0.6320060025900602 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "RobotStudio/so101_new_calib_SysID/so101_new_calib.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "so101_new_calib" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "so101_new_calib" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Robot = "none" + } + variantSets = ["Robot", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + over "base" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "shoulder" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "upper_arm" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "lower_arm" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "wrist" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "gripper" + { + over "collisions" + { + token visibility = "invisible" + } + } + + over "moving_jaw_so101_v1" + { + over "collisions" + { + over "Cube_05" + { + over "Cube_05" + { + token visibility = "invisible" + } + } + + over "Cube_02" + { + over "Cube_02" + { + token visibility = "invisible" + } + } + + over "Cube_06" + { + over "Cube_06" + { + token visibility = "invisible" + } + } + + over "Cube_03" + { + over "Cube_03" + { + token visibility = "invisible" + } + } + + over "Cylinder_02" + { + over "Cylinder_02" + { + token visibility = "invisible" + } + } + + over "Cube_07" + { + over "Cube_07" + { + token visibility = "invisible" + } + } + + over "Cube_007" + { + over "Cube_007" + { + token visibility = "invisible" + } + } + + over "Cube_04" + { + over "Cube_04" + { + token visibility = "invisible" + } + } + + over "Cylinder_01" + { + over "Cylinder_01" + { + token visibility = "invisible" + } + } + } + } + variantSet "Robot" = { + "none" ( + prepend payload = @./payloads/Robot/none.usda@ + ) { + + } + "robot" ( + prepend payload = @./payloads/Robot/robot.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/techman_tm12/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/techman_tm12/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..f3835025656b3a401c281f6ab766d3a6ac9bd95e --- /dev/null +++ b/techman_tm12/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:31", + "assets": [ + { + "asset": "tm12.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/techman_tm12/.metadata/com.nvidia.simready.packaging.bom.json b/techman_tm12/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..d30cbf494e3ab1632165ca78336241291c129aba --- /dev/null +++ b/techman_tm12/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,190 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.tm12.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "3654b8061163092cdbb3f68effea63703a54ecd2aeb07709108c5a1ce95353c6", + "sha256": "7216ff641946743625c323a9f05a0ae528e64ebb5e4269095531f3ddade413d1" + } + }, + { + "relative_path": ".thumbs/256x256/tm12.usda.png", + "size": 37076, + "hash": { + "sha256-flat-1mb": "c87687469086dfab1c77615faae1ab9f32368335bea516e605f0c57b7902164f", + "sha256": "38f3180feaea6d8101a1793633147ee81cb46c191a2205a1791cfb349045d804" + } + }, + { + "relative_path": ".thumbs/tm12.thumb.usd", + "size": 6097, + "hash": { + "sha256-flat-1mb": "9843566bcbe1baebf38ec93919576d93ec8bbcee5c61e95c36e3ea1ad668718b", + "sha256": "84168bdeb8a5e8f1baf8c113cb6fbaf5c24072639fb049ba78d69f65f8cbb009" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 2401, + "hash": { + "sha256-flat-1mb": "cbb7a1b7c989e06287aab9200e1de6d695f512dd67b725b28585e187c3fe9695", + "sha256": "93a82cc525133910b241e7867de3b351bea583cda3991b8832447c32ca34de11" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12103, + "hash": { + "sha256-flat-1mb": "51cfa0aee41bef045fc1634840d4a8edb4e027ec64bd8bf7a10550eb1c992147", + "sha256": "1be2aa853e3eff99cec50a5435c7dc4116ce1cf988f4cf859a14e301f86ae0e5" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 3097, + "hash": { + "sha256-flat-1mb": "57722c9650469175833575635469fa46fb709c76d8e65bc2ae498cf8db112e12", + "sha256": "a3a6624019b96a3298984e86a43bc395496469a2a6d042be906ab804f63da872" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 17232, + "hash": { + "sha256-flat-1mb": "f0def2fdf41ce5904af396edbfad3feb11323d8f183ada236aca626402c27e1a", + "sha256": "52a47cd96babda4bf76639277261bd1e0626e9f9c6f355ed2fd97ad097cb4d8e" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 19050570, + "hash": { + "sha256-flat-1mb": "62707afc465c51bbe70358f837be8db816241728b1726212b2493fa6746aa2a9", + "sha256": "69afc8e8550562abbb3f8a66945365b7368cd6ddeddba86e35171a25b3046903", + "sha256-first1m": "4698689c06db26e0ef72468a13a84dcef10d20cdbb8403c0c376c1b274382048" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 58180, + "hash": { + "sha256-flat-1mb": "20d6ac008360021105a174722621767053373a1ae38a006117e06426594ed57a", + "sha256": "9276463f9b500e8ba70e7b17b3e3c43c9ab44e45de970ecd3719b2703ffa1003" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 35358, + "hash": { + "sha256-flat-1mb": "5de9cf83e57f0f03fa919f4ff8d9353250bba6b1e8690efb1100e0e86fac8b83", + "sha256": "c81619638230eb161545724b10777c3ccabef7c5837e21f274c22f309b55ed4f" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 8504, + "hash": { + "sha256-flat-1mb": "3e2b50e0bf589c06ebc3c6c6d9863204ba0cb873724d9032e8dca8ffb874f551", + "sha256": "6dbe7e2d3c021a3649547974fd6a904e1b09e72722146e74bca73ead67d0470b" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 7798, + "hash": { + "sha256-flat-1mb": "772b25a29d0c976ee2c1c61bf6dc378d5fbb335627e04b6628133621d6d186c3", + "sha256": "69912d5efe368caa918d1454ae58c3f3930e94f8ba44a9556ab4a68408331f95" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4366, + "hash": { + "sha256-flat-1mb": "1d6b71bc65fc7734abedd15da3fdf44f4a9e795d3f5e5658fce80cada5559240", + "sha256": "f7cf6ae591eaaa392426355b2c11d4d99a6149fc0f0ac3bd7fbb8c9cda346b24" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 168410, + "hash": { + "sha256-flat-1mb": "7189ab5c8f48a77e2c539dce74f5fe4e9aa316f34de0e82ddf600bbc7e6a1beb", + "sha256": "8e066b8b76cb54707456378e6870dd3903fe7134a7a9a3f16ab86e97e337b7a9" + } + }, + { + "relative_path": "tm12.usda", + "size": 17040, + "hash": { + "sha256-flat-1mb": "2d9e2eb7446a0b87310f68d536d303ee0c69bc1a5768d097afc308d1f6da65c0", + "sha256": "0dce04d5a5dc2baa134a8f2db91b6f9e747bf2a69c2c24d3557ec1a979645f2c" + } + } + ] +} \ No newline at end of file diff --git a/techman_tm12/.metadata/com.nvidia.simready.root_usds.json b/techman_tm12/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..b1933744760be71015e1aab4c97847db2645caa6 --- /dev/null +++ b/techman_tm12/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "tm12.usda" + ] +} diff --git a/techman_tm12/.simready/validation.json b/techman_tm12/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/techman_tm12/.simready/validation.json @@ -0,0 +1,223 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/techman_tm12/.thumbs/256x256/.tm12.usda.last_generated b/techman_tm12/.thumbs/256x256/.tm12.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..46223160130d218dac80bd49486a7562903804a6 --- /dev/null +++ b/techman_tm12/.thumbs/256x256/.tm12.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:43:00 \ No newline at end of file diff --git a/techman_tm12/.thumbs/256x256/tm12.usda.png b/techman_tm12/.thumbs/256x256/tm12.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..795eee7628ac92dabdac060dc8068d1b4b9a4f02 --- /dev/null +++ b/techman_tm12/.thumbs/256x256/tm12.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38f3180feaea6d8101a1793633147ee81cb46c191a2205a1791cfb349045d804 +size 37076 diff --git a/techman_tm12/.thumbs/tm12.thumb.usd b/techman_tm12/.thumbs/tm12.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..864f4b1a1defc61d96e761a83bc5926a9909df83 Binary files /dev/null and b/techman_tm12/.thumbs/tm12.thumb.usd differ diff --git a/techman_tm12/com.nvidia.simready.packaging.json b/techman_tm12/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..6c8748face6cd2042fc07021701dd8fd13596276 --- /dev/null +++ b/techman_tm12/com.nvidia.simready.packaging.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.0", + "package_id": "techman_tm12.1.0.0", + "license": "unknown", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "cb78288e9cfa1d849ae4ce49b8b7cd2e1fd5bf8469ac6f669e088a9f93e62ca4" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "e29ddc1894cf95ac31993f16f256091908db7fde73525bd245ba9308f067b1fc" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "ee0297337f7bb8989b220d7df9cef25ccf4d5564a647fda464385406ffdb7fbb" + } + } + ], + "content_hash": { + "sha256": "466bf1a6ad8168264365af6d7443e3e43b5c02c87f208ddbb90b0bd4b62e9ae9" + }, + "package_hash": { + "sha256": "2843eb5f46a7fff1caa71fc9f48b2570d7f80afb857d44e2c869d78ffb44ae20" + } +} \ No newline at end of file diff --git a/techman_tm12/materials/mdl/LICENSE.md b/techman_tm12/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/techman_tm12/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/techman_tm12/materials/mdl/OmniPBR.mdl b/techman_tm12/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/techman_tm12/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/techman_tm12/materials/mdl/OmniPBRBase.mdl b/techman_tm12/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/techman_tm12/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/techman_tm12/materials/mdl/OmniPBR_ClearCoat.mdl b/techman_tm12/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/techman_tm12/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/techman_tm12/materials/mdl/aux_definitions.mdl b/techman_tm12/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/techman_tm12/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/techman_tm12/materials/mdl/core_definitions.mdl b/techman_tm12/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/techman_tm12/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/techman_tm12/materials/mdl/support_definitions.mdl b/techman_tm12/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/techman_tm12/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/techman_tm12/payloads/Physics/mujoco.usda b/techman_tm12/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..5578a65e5f9c7fe2df908017459304466a5a8113 --- /dev/null +++ b/techman_tm12/payloads/Physics/mujoco.usda @@ -0,0 +1,164 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "tm12" +{ + over "base" + { + over "base_fixed_joint" + { + } + } + + over "root_joint" + { + } + + over "link_0" + { + over "shoulder_1_joint" ( + delete apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + } + + over "visuals" + { + } + + over "collisions" + { + } + } + + over "link_1" + { + over "shoulder_2_joint" ( + delete apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + } + + over "visuals" + { + } + + over "collisions" + { + } + } + + over "link_2" + { + over "elbow_joint" ( + delete apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + } + + over "visuals" + { + } + + over "collisions" + { + } + } + + over "link_3" + { + over "wrist_1_joint" ( + delete apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + } + + over "visuals" + { + } + + over "collisions" + { + } + } + + over "link_4" + { + over "wrist_2_joint" ( + delete apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + } + + over "visuals" + { + } + + over "collisions" + { + } + } + + over "link_5" + { + over "wrist_3_joint" ( + delete apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + } + + over "visuals" + { + } + + over "collisions" + { + } + } + + over "link_6" + { + over "flange_fixed_joint" + { + } + + over "visuals" + { + } + + over "collisions" + { + } + + over "flange_link" + { + over "flange_link_tool0" + { + } + } + + over "tool0" + { + over "Tm12_Camera" + { + } + } + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/techman_tm12/payloads/Physics/physics.usda b/techman_tm12/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..06deee94864bd620d6d8e0f91d75fd0b4f9b7d4c --- /dev/null +++ b/techman_tm12/payloads/Physics/physics.usda @@ -0,0 +1,348 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "tm12" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "tm12" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] +) +{ + over "base" ( + ) + { + def PhysicsFixedJoint "base_fixed_joint" + { + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + } + } + + over "link_0" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.0011083329, 0.0011083329, 0.0018) + float physics:mass = 1 + + def PhysicsRevoluteJoint "shoulder_1_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 35300 + float drive:angular:physics:stiffness = 1000 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0.1652) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.70710677, 0, -0.70710677, 0) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -270 + float physics:upperLimit = 270 + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + + over "link_1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.020289334, 0.020289334, 0.021396272) + float physics:mass = 7.6 + + def PhysicsRevoluteJoint "shoulder_2_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 35300 + float drive:angular:physics:stiffness = 1000 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1.4901161e-7, -0.7071066, -0.7071068, 8.940697e-8) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + + over "link_2" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.07150572, 1.1758789, 1.2033933) + float physics:mass = 14.0239 + + def PhysicsRevoluteJoint "elbow_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 15700 + float drive:angular:physics:stiffness = 1000 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0.6361, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.70710677, 0, -0.70710677, 0) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -166 + float physics:upperLimit = 166 + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + + over "link_3" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.009755469, 0.16334718, 0.16656677) + float physics:mass = 3.3577 + + def PhysicsRevoluteJoint "wrist_1_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 5400 + float drive:angular:physics:stiffness = 1000 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0.5579, 0, -0.1563) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.50000006, 0.4999999, -0.50000006, 0.4999999) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + + over "link_4" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.002058405, 0.002563079, 0.00264321) + float physics:mass = 1.576 + + def PhysicsRevoluteJoint "wrist_2_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 5400 + float drive:angular:physics:stiffness = 1000 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, -0.106, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.50000006, 0.4999999, -0.50000006, -0.4999999) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions_4" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + + over "link_5" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.002058405, 0.002563079, 0.00264321) + float physics:mass = 1.576 + + def PhysicsRevoluteJoint "wrist_3_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 5400 + float drive:angular:physics:stiffness = 1000 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (-0.00009758154, -0.1131499, -0.00005177066) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.50000006, 0.4999999, -0.50000006, -0.4999999) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -270 + float physics:upperLimit = 270 + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + + over "link_6" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0) + float3 physics:diagonalInertia = (0.000774544, 0.001383811, 0.001559496) + float physics:mass = 0.65 + + def PhysicsFixedJoint "flange_fixed_joint" + { + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + } + + over "collisions" ( + instanceable = false + ) + { + over "collisions_6" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + + over "flange_link" ( + ) + { + def PhysicsFixedJoint "flange_link_tool0" + { + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + } + } + + over "tool0" ( + ) + { + } + } + + def PhysicsFixedJoint "root_joint" + { + custom rel physics:body1 = + } +} + +def PhysicsScene "physicsScene" +{ + vector3f physics:gravityDirection = (0, 0, -1) + float physics:gravityMagnitude = 9.81 +} diff --git a/techman_tm12/payloads/Physics/physx.usda b/techman_tm12/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..6597fe9f1f173543581239b2724ee29137be58df --- /dev/null +++ b/techman_tm12/payloads/Physics/physx.usda @@ -0,0 +1,142 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "tm12" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./physics.usda@ + ] + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "tm12" ( + prepend apiSchemas = ["PhysxArticulationAPI"] +) +{ + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 16 + + over "base" ( + ) + { + } + + over "link_0" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "shoulder_1_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 120 + } + } + + over "link_1" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "shoulder_2_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 120 + } + } + + over "link_2" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "elbow_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + } + } + + over "link_3" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "wrist_1_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + } + } + + over "link_4" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "wrist_2_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + } + } + + over "link_5" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "wrist_3_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + } + } + + over "link_6" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "flange_link" ( + ) + { + } + } +} + +over "physicsScene" ( + prepend apiSchemas = ["PhysxSceneAPI"] +) +{ + uniform token physxScene:broadphaseType = "MBP" + bool physxScene:enableCCD = 1 + bool physxScene:enableGPUDynamics = 0 + bool physxScene:enableStabilization = 1 + uniform token physxScene:solverType = "TGS" +} + diff --git a/techman_tm12/payloads/base.usda b/techman_tm12/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..1bd254176ecb2b30163eb79b3122eefab108bb21 --- /dev/null +++ b/techman_tm12/payloads/base.usda @@ -0,0 +1,555 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "tm12" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./robot.usda@ + ] + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "tm12" +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "base" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "link_0" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals" + { + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "link_1" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.16519999504089355) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals_1" + { + over "material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "link_2" + { + quatd xformOp:orient = (0.5000001788139343, -0.4999999701976776, -0.4999999701976776, -0.4999998211860657) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.16519999504089355) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals_2" + { + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "link_3" + { + quatd xformOp:orient = (0.5000001788139343, -0.4999999701976776, -0.4999999701976776, -0.4999998211860657) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (1.7881393432617188e-7, -5.960464477539063e-8, 0.8012999296188354) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals_3" + { + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "link_4" + { + quatd xformOp:orient = (0.7071067690849304, -0.7071067094802856, -1.1920928955078125e-7, 1.1920928955078125e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (3.8743019104003906e-7, -0.15630008280277252, 1.35919988155365) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals_4" + { + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "link_5" + { + quatd xformOp:orient = (0.9999998807907104, -8.940696716308594e-8, -2.842170943040401e-14, 1.6858739115832577e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (3.8743019104003906e-7, -0.15630008280277252, 1.4651998281478882) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals_5" + { + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "link_6" + { + quatd xformOp:orient = (0.70710688829422, 0.7071065306663513, 1.192092469182171e-7, 1.1920931797249068e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (4.255815042597533e-7, -0.26945003867149353, 1.4651998281478882) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + over "visuals_6" + { + over "material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + + over "material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + } + } + } + + def Xform "collisions" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "flange_link" + { + quatd xformOp:orient = (0.70710688829422, 0.7071065306663513, 1.192092469182171e-7, 1.1920931797249068e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (4.255815042597533e-7, -0.26945003867149353, 1.4651998281478882) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "tool0" + { + quatd xformOp:orient = (0.70710688829422, 0.7071065306663513, 1.192092469182171e-7, 1.1920931797249068e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (4.255815042597533e-7, -0.26945003867149353, 1.4651998281478882) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Camera "Tm12_Camera" + { + float focalLength = 24 + float focusDistance = 400 + custom uniform vector3d omni:kit:centerOfInterest = (0, 0, -400) + quatd xformOp:orient = (6.123233995736766e-17, 6.123233995736766e-17, 1, 6.123233995736766e-17) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.00034269540112144976, 0.07484554695861911, 0.04845830019598468) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Scope "Looks" + { + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/techman_tm12/payloads/geometries.usd b/techman_tm12/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..b0d852e614b9b4e9c080a78943a18777adc896ad --- /dev/null +++ b/techman_tm12/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69afc8e8550562abbb3f8a66945365b7368cd6ddeddba86e35171a25b3046903 +size 19050570 diff --git a/techman_tm12/payloads/instances.usda b/techman_tm12/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..02c4144a69db1a0187c440227665fb0cb25a3e59 --- /dev/null +++ b/techman_tm12/payloads/instances.usda @@ -0,0 +1,1594 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "visuals" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_DEFAULT_MTL" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.708375, 0.73791, 0.760525) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.651405, 0.651405, 0.651406) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.009721, 0.009721, 0.009721) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } + + def Xform "visuals_1" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals_1" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_DEFAULT_MTL_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0.8, 0.8) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL0_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.132868, 0.132868, 0.147027) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.201556, 0.168269, 0.168269) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.961, 0.961, 0.961) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.361306, 0.361306, 0.361307) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions_1" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions_1" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } + + def Xform "visuals_2" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals_2" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_6" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_DEFAULT_MTL_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0.8, 0.8) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL0_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.132868, 0.132868, 0.147027) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.201556, 0.168269, 0.168269) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.961, 0.961, 0.961) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.361306, 0.361306, 0.361307) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.72, 0.74, 0.77) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions_2" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions_2" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } + + def Xform "visuals_3" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals_3" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_6" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_MTL0_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.132868, 0.132868, 0.147027) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.964685, 0.964685, 0.964686) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL3_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.361306, 0.361306, 0.361307) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL4_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.723054, 0.73791, 0.768151) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL5_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.708375, 0.73791, 0.760525) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL6_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.201556, 0.168269, 0.168269) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions_3" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions_3" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } + + def Xform "visuals_4" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals_4" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_MTL0_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.132868, 0.132868, 0.147027) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.961, 0.961, 0.961) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL3_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.201556, 0.168269, 0.168269) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.361306, 0.361306, 0.361307) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL5_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.723054, 0.73791, 0.768151) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions_4" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions_4" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } + + def Xform "visuals_5" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals_5" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_MTL0_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.132868, 0.132868, 0.147027) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.961, 0.961, 0.961) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL3_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.201556, 0.168269, 0.168269) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.361306, 0.361306, 0.361307) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL5_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.723054, 0.73791, 0.768151) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions_5" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions_5" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } + + def Xform "visuals_6" ( + prepend references = @./geometries.usd@ + ) + { + over "visuals_6" + { + over "material_0" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "material_6" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_DEFAULT_MTL_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0.8, 0.8) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL0_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.651405, 0.651405, 0.651406) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL1_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.076185, 0.076185, 0.076185) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL2_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL3_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.708375, 0.73791, 0.760525) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL4_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.527115, 0.539479, 0.558341) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_MTL6_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.723054, 0.73791, 0.768151) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "collisions_6" ( + prepend references = @./geometries.usd@ + ) + { + over "collisions_6" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + token purpose = "guide" + } + } +} + diff --git a/techman_tm12/payloads/materials.usda b/techman_tm12/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..36a0042e67b86edbe4960845743f6e30a5df9938 --- /dev/null +++ b/techman_tm12/payloads/materials.usda @@ -0,0 +1,914 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "material_DEFAULT_MTL" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.708375, 0.73791, 0.760525) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.708375, 0.73791, 0.760525) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL0" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL1" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.651405, 0.651405, 0.651406) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.651405, 0.651405, 0.651406) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL2" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.009721, 0.009721, 0.009721) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.009721, 0.009721, 0.009721) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_DEFAULT_MTL_1" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.8, 0.8, 0.8) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0.8, 0.8) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL0_1" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.132868, 0.132868, 0.147027) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.132868, 0.132868, 0.147027) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL1_1" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.201556, 0.168269, 0.168269) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.201556, 0.168269, 0.168269) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL2_1" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.035601, 0.035601, 0.035601) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.035601, 0.035601, 0.035601) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL3" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.961, 0.961, 0.961) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.961, 0.961, 0.961) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL4" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.361306, 0.361306, 0.361307) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.361306, 0.361306, 0.361307) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL5" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.72, 0.74, 0.77) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.72, 0.74, 0.77) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL2_3" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.964685, 0.964685, 0.964686) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.964685, 0.964685, 0.964686) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL4_1" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.723054, 0.73791, 0.768151) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.723054, 0.73791, 0.768151) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL1_4" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.076185, 0.076185, 0.076185) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.076185, 0.076185, 0.076185) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_MTL4_2" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:id = "UsdPreviewSurface" + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.527115, 0.539479, 0.558341) + color3f inputs:emissive_color = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.527115, 0.539479, 0.558341) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/techman_tm12/payloads/robot.usda b/techman_tm12/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..116cf2a1b4c9316f1050936e9bb1283c999b1889 --- /dev/null +++ b/techman_tm12/payloads/robot.usda @@ -0,0 +1,280 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "tm12" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "tm12" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string[] isaac:changelog ( + displayName = "Changelog" + ) + string isaac:description ( + displayName = "Description" + ) + token isaac:license ( + displayName = "License" + ) + string isaac:namespace ( + displayName = "Namespace" + ) + rel isaac:physics:robotJoints ( + displayName = "Robot Joints" + ) + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + , + ] + rel isaac:physics:robotLinks ( + displayName = "Robot Links" + ) + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" ( + displayName = "Robot Type" + ) + string isaac:source ( + displayName = "Source" + ) + string isaac:version ( + displayName = "Version" + ) + + over "base" + { + string isaac:nameOverride + + over "base_fixed_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "link_0" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "shoulder_1_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "link_1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "shoulder_2_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "link_2" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "elbow_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "link_3" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "wrist_1_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "link_4" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "wrist_2_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "link_5" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "wrist_3_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "link_6" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "flange_fixed_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "flange_link" + { + string isaac:nameOverride + + over "flange_link_tool0" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "tool0" + { + string isaac:nameOverride + } + } +} diff --git a/techman_tm12/runnables/physics/mujoco.usda b/techman_tm12/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..1700c7c48c538960b55fee4f4a5f4a81c60b6c32 --- /dev/null +++ b/techman_tm12/runnables/physics/mujoco.usda @@ -0,0 +1,228 @@ +#usda 1.0 +( + defaultPrim = "tm12" +) + +def "tm12" +{ + over "link_0" + { + over "collisions" + { + over "collisions" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "shoulder_1_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link_1" + { + over "collisions" + { + over "collisions_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "shoulder_2_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link_2" + { + over "collisions" + { + over "collisions_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "elbow_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link_3" + { + over "collisions" + { + over "collisions_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_1_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link_4" + { + over "collisions" + { + over "collisions_4" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_2_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link_5" + { + over "collisions" + { + over "collisions_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_3_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link_6" + { + over "collisions" + { + over "collisions_6" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_tm12_link_0_shoulder_1_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -57295.77951308232, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35300 + double mjc:forceRange:min = -35300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_tm12_link_1_shoulder_2_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -57295.77951308232, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 35300 + double mjc:forceRange:min = -35300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_tm12_link_2_elbow_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -57295.77951308232, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 15700 + double mjc:forceRange:min = -15700 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_tm12_link_3_wrist_1_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -57295.77951308232, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 5400 + double mjc:forceRange:min = -5400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_tm12_link_4_wrist_2_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -57295.77951308232, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 5400 + double mjc:forceRange:min = -5400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_tm12_link_5_wrist_3_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -57295.77951308232, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 5400 + double mjc:forceRange:min = -5400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } +} + diff --git a/techman_tm12/runnables/physics/newton.usda b/techman_tm12/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..fcce23eda5842add98ae71b874358bb762262300 --- /dev/null +++ b/techman_tm12/runnables/physics/newton.usda @@ -0,0 +1,163 @@ +#usda 1.0 +( + defaultPrim = "tm12" +) + +over "tm12" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] +) +{ + bool newton:selfCollisionEnabled = 0 + + over "link_0" + { + over "collisions" + { + over "collisions" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "shoulder_1_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 11031.25 + float newton:damping = 367.70834 + float newton:velocityLimit = 120 + } + } + + over "link_1" + { + over "collisions" + { + over "collisions_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "shoulder_2_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 11031.25 + float newton:damping = 367.70834 + float newton:velocityLimit = 120 + } + } + + over "link_2" + { + over "collisions" + { + over "collisions_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "elbow_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 3270.8333 + float newton:damping = 109.02778 + float newton:velocityLimit = 180 + } + } + + over "link_3" + { + over "collisions" + { + over "collisions_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_1_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 1125 + float newton:damping = 37.5 + float newton:velocityLimit = 180 + } + } + + over "link_4" + { + over "collisions" + { + over "collisions_4" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_2_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 1125 + float newton:damping = 37.5 + float newton:velocityLimit = 180 + } + } + + over "link_5" + { + over "collisions" + { + over "collisions_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + + over "wrist_3_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 1125 + float newton:damping = 37.5 + float newton:velocityLimit = 180 + } + } + + over "link_6" + { + over "collisions" + { + over "collisions_6" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } +} + diff --git a/techman_tm12/runnables/physics/physx.usda b/techman_tm12/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..eb4b1fba0ab86d4718026343c51c0c20f4a18a38 --- /dev/null +++ b/techman_tm12/runnables/physics/physx.usda @@ -0,0 +1,217 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "tm12" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "tm12" ( + prepend apiSchemas = ["PhysxArticulationAPI"] +) +{ + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 16 + + over "base" ( + ) + { + } + + over "link_0" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "shoulder_1_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 120 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "collisions" + { + over "collisions" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 172, 186, 180, 177, 203, 22, 232, 151, 74, 34, 37, 202, 163, 39, 113, 210, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 45, 0, 0, 0, 107, 128, 0, 0, 64, 0, 0, 0, 214, 0, 0, 0, 113, 32, 196, 61, 232, 108, 1, 189, 182, 104, 129, 60, 142, 206, 121, 61, 113, 204, 50, 189, 184, 30, 133, 61, 80, 169, 146, 61, 80, 169, 146, 189, 240, 77, 83, 60, 113, 32, 196, 61, 232, 108, 1, 61, 182, 104, 129, 60, 254, 129, 146, 61, 70, 125, 146, 61, 110, 248, 93, 60, 44, 182, 137, 61, 153, 15, 8, 61, 184, 30, 133, 61, 94, 46, 34, 61, 12, 115, 130, 61, 184, 30, 133, 61, 232, 108, 1, 61, 113, 32, 196, 61, 182, 104, 129, 60, 156, 83, 73, 55, 19, 153, 153, 61, 184, 30, 133, 61, 135, 224, 152, 61, 33, 204, 237, 187, 184, 30, 133, 61, 238, 175, 30, 61, 20, 34, 192, 189, 0, 0, 0, 0, 173, 252, 146, 61, 173, 252, 146, 189, 0, 0, 0, 0, 77, 17, 192, 189, 184, 1, 31, 61, 0, 0, 0, 0, 181, 222, 207, 189, 156, 83, 73, 54, 0, 0, 0, 0, 208, 212, 203, 189, 37, 173, 248, 59, 184, 60, 86, 61, 78, 14, 31, 189, 40, 14, 192, 189, 0, 0, 0, 0, 80, 169, 146, 189, 80, 169, 146, 189, 240, 77, 83, 60, 48, 242, 146, 189, 163, 6, 147, 189, 0, 0, 0, 0, 189, 30, 204, 189, 119, 44, 54, 188, 231, 52, 75, 61, 8, 33, 192, 189, 84, 27, 28, 189, 65, 130, 98, 60, 33, 86, 127, 189, 171, 206, 42, 189, 184, 30, 133, 61, 29, 202, 16, 189, 142, 119, 135, 189, 184, 30, 133, 61, 24, 180, 16, 61, 95, 126, 135, 189, 184, 30, 133, 61, 187, 15, 192, 61, 247, 6, 31, 61, 0, 0, 0, 0, 48, 242, 146, 61, 163, 6, 147, 61, 0, 0, 0, 0, 181, 222, 207, 61, 156, 83, 73, 182, 0, 0, 0, 0, 77, 17, 192, 61, 184, 1, 31, 189, 0, 0, 0, 0, 78, 14, 31, 61, 40, 14, 192, 61, 0, 0, 0, 0, 181, 254, 150, 56, 181, 222, 207, 61, 0, 0, 0, 0, 238, 175, 30, 189, 20, 34, 192, 61, 0, 0, 0, 0, 173, 252, 146, 189, 173, 252, 146, 61, 0, 0, 0, 0, 186, 17, 22, 189, 232, 105, 192, 61, 182, 104, 129, 60, 187, 15, 192, 189, 247, 6, 31, 189, 0, 0, 0, 0, 181, 254, 150, 184, 181, 222, 207, 189, 0, 0, 0, 0, 232, 108, 1, 189, 113, 32, 196, 189, 182, 104, 129, 60, 0, 0, 0, 0, 28, 37, 207, 189, 135, 249, 114, 60, 156, 83, 73, 183, 19, 153, 153, 189, 184, 30, 133, 61, 232, 108, 1, 61, 113, 32, 196, 189, 182, 104, 129, 60, 154, 147, 151, 189, 232, 188, 70, 60, 184, 30, 133, 61, 27, 243, 58, 189, 231, 195, 115, 61, 184, 30, 133, 61, 155, 112, 175, 187, 83, 60, 206, 61, 182, 104, 129, 60, 199, 41, 154, 189, 110, 104, 138, 61, 110, 248, 93, 60, 198, 134, 206, 61, 0, 0, 0, 0, 182, 104, 129, 60, 207, 75, 197, 188, 33, 119, 145, 61, 184, 30, 133, 61, 37, 62, 183, 189, 47, 50, 65, 61, 135, 249, 114, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 128, 0, 0, 16, 1, 11, 115, 67, 63, 162, 130, 251, 190, 110, 172, 214, 62, 101, 23, 195, 189, 16, 0, 3, 12, 120, 58, 67, 63, 106, 51, 249, 62, 164, 36, 218, 62, 115, 217, 194, 189, 19, 0, 3, 32, 35, 74, 37, 63, 183, 239, 21, 63, 189, 223, 250, 62, 182, 252, 193, 189, 22, 0, 3, 17, 65, 230, 249, 62, 236, 238, 67, 63, 79, 202, 214, 62, 17, 68, 195, 189, 25, 0, 3, 15, 57, 255, 114, 62, 72, 190, 84, 63, 51, 201, 0, 63, 104, 158, 194, 189, 28, 0, 3, 15, 216, 183, 79, 63, 168, 233, 155, 190, 210, 111, 255, 62, 212, 251, 194, 189, 31, 0, 3, 12, 125, 79, 91, 63, 98, 126, 32, 62, 113, 160, 251, 62, 126, 15, 194, 189, 34, 0, 3, 13, 175, 23, 14, 63, 126, 230, 84, 191, 5, 13, 140, 60, 87, 211, 203, 189, 37, 0, 3, 29, 243, 19, 123, 191, 207, 162, 71, 62, 239, 145, 14, 60, 221, 223, 203, 189, 40, 0, 3, 0, 67, 42, 14, 191, 152, 217, 84, 191, 108, 9, 143, 60, 17, 217, 203, 189, 43, 0, 3, 24, 22, 210, 127, 191, 7, 29, 13, 59, 227, 10, 25, 61, 109, 185, 207, 189, 46, 0, 3, 25, 245, 81, 76, 191, 167, 89, 9, 191, 106, 88, 140, 62, 82, 251, 202, 189, 49, 0, 3, 24, 82, 61, 43, 191, 134, 70, 22, 191, 107, 127, 233, 62, 136, 61, 196, 189, 52, 0, 3, 24, 172, 221, 236, 190, 182, 178, 251, 189, 25, 196, 96, 63, 248, 111, 186, 189, 55, 0, 3, 23, 206, 230, 22, 191, 31, 155, 38, 191, 235, 1, 245, 62, 202, 137, 194, 189, 58, 0, 3, 24, 179, 170, 20, 63, 85, 126, 41, 191, 174, 137, 242, 62, 232, 200, 194, 189, 61, 0, 3, 30, 195, 201, 84, 63, 84, 50, 14, 63, 236, 140, 195, 60, 246, 206, 203, 189, 64, 0, 3, 17, 130, 28, 88, 63, 192, 6, 5, 63, 135, 207, 6, 62, 17, 116, 203, 189, 67, 0, 3, 32, 236, 240, 122, 63, 79, 140, 71, 62, 52, 90, 11, 189, 206, 194, 203, 189, 70, 0, 3, 18, 110, 241, 122, 63, 92, 135, 71, 190, 22, 226, 10, 189, 213, 195, 203, 189, 73, 0, 3, 14, 43, 46, 88, 63, 150, 237, 4, 191, 115, 151, 6, 62, 118, 121, 203, 189, 76, 0, 3, 12, 44, 215, 84, 63, 160, 46, 14, 191, 34, 16, 140, 60, 183, 215, 203, 189, 79, 0, 3, 44, 209, 245, 71, 62, 227, 235, 122, 63, 154, 247, 10, 189, 101, 198, 203, 189, 82, 0, 3, 34, 15, 10, 5, 63, 118, 25, 88, 63, 105, 233, 6, 62, 99, 115, 203, 189, 85, 0, 3, 15, 147, 36, 14, 63, 20, 209, 84, 63, 148, 139, 203, 60, 232, 208, 203, 189, 88, 0, 3, 15, 74, 204, 13, 191, 133, 117, 84, 63, 12, 89, 136, 61, 47, 103, 203, 189, 91, 0, 3, 10, 194, 209, 84, 191, 172, 55, 14, 191, 123, 53, 136, 60, 160, 214, 203, 189, 94, 0, 3, 23, 65, 59, 85, 191, 3, 128, 13, 191, 216, 60, 217, 60, 185, 236, 203, 189, 97, 0, 3, 23, 174, 129, 121, 191, 86, 250, 100, 190, 9, 213, 22, 60, 78, 248, 204, 189, 100, 0, 3, 3, 82, 20, 123, 191, 116, 168, 71, 190, 121, 51, 246, 187, 141, 223, 203, 189, 103, 0, 3, 3, 7, 215, 10, 190, 126, 237, 96, 191, 186, 108, 234, 62, 154, 232, 195, 189, 106, 0, 3, 28, 221, 159, 88, 190, 113, 42, 88, 191, 239, 254, 251, 62, 203, 56, 195, 189, 109, 0, 3, 27, 57, 74, 251, 190, 62, 50, 67, 191, 129, 217, 215, 62, 164, 241, 194, 189, 112, 0, 3, 27, 131, 237, 4, 191, 117, 45, 88, 191, 12, 171, 6, 62, 132, 121, 203, 189, 115, 0, 3, 27, 209, 245, 71, 190, 227, 235, 122, 191, 154, 247, 10, 189, 101, 198, 203, 189, 118, 0, 3, 7, 158, 21, 43, 190, 38, 83, 124, 191, 128, 98, 199, 60, 12, 233, 204, 189, 121, 0, 3, 28, 117, 238, 4, 63, 104, 54, 88, 191, 75, 181, 5, 62, 218, 120, 203, 189, 124, 0, 3, 29, 17, 74, 251, 62, 16, 50, 67, 191, 87, 218, 215, 62, 137, 241, 194, 189, 127, 0, 3, 29, 131, 80, 88, 62, 57, 49, 88, 191, 177, 248, 251, 62, 148, 56, 195, 189, 130, 0, 3, 29, 116, 213, 10, 62, 204, 235, 96, 191, 118, 115, 234, 62, 160, 231, 195, 189, 133, 0, 3, 28, 242, 35, 43, 62, 21, 85, 124, 191, 49, 25, 186, 60, 0, 222, 204, 189, 136, 0, 3, 28, 112, 192, 70, 62, 198, 252, 122, 191, 1, 47, 8, 189, 105, 197, 203, 189, 139, 0, 3, 40, 157, 45, 239, 190, 125, 52, 143, 62, 6, 186, 86, 63, 22, 106, 189, 189, 142, 0, 3, 26, 75, 65, 220, 190, 186, 15, 191, 189, 60, 221, 101, 63, 250, 106, 182, 189, 145, 0, 3, 23, 26, 213, 70, 190, 221, 22, 123, 63, 164, 121, 140, 188, 152, 218, 203, 189, 148, 0, 3, 37, 190, 230, 87, 190, 227, 49, 122, 63, 170, 156, 160, 60, 82, 129, 204, 189, 151, 0, 3, 37, 190, 53, 242, 61, 171, 167, 98, 63, 174, 48, 230, 62, 241, 215, 195, 189, 154, 0, 3, 33, 43, 247, 6, 62, 131, 152, 124, 63, 60, 204, 194, 61, 10, 32, 205, 189, 157, 0, 3, 33, 135, 148, 42, 191, 197, 89, 19, 63, 241, 179, 242, 62, 190, 138, 195, 189, 160, 0, 3, 11, 146, 53, 7, 191, 62, 240, 60, 63, 24, 1, 215, 62, 170, 57, 195, 189, 163, 0, 3, 11, 52, 146, 16, 191, 12, 125, 81, 63, 127, 14, 219, 61, 43, 74, 203, 189, 166, 0, 3, 11, 134, 139, 124, 63, 155, 87, 34, 62, 236, 172, 39, 61, 69, 16, 205, 189, 169, 0, 3, 13, 159, 142, 93, 63, 36, 108, 14, 62, 128, 107, 246, 62, 136, 79, 194, 189, 172, 0, 3, 13, 63, 222, 97, 63, 146, 49, 17, 190, 202, 204, 229, 62, 7, 189, 196, 189, 175, 0, 3, 13, 92, 139, 124, 63, 129, 87, 34, 190, 246, 235, 39, 61, 163, 16, 205, 189, 178, 0, 3, 13, 39, 238, 18, 190, 173, 228, 94, 63, 63, 224, 240, 62, 192, 91, 196, 189, 181, 0, 3, 33, 218, 109, 64, 190, 140, 254, 94, 63, 129, 86, 232, 62, 51, 99, 196, 189, 184, 0, 3, 10, 114, 9, 213, 190, 149, 107, 71, 63, 153, 45, 240, 62, 233, 72, 196, 189, 187, 0, 3, 10, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 63, 183, 30, 133, 189, 190, 0, 12, 10, 244, 255, 63, 191, 152, 143, 11, 63, 126, 199, 191, 62, 59, 120, 201, 189, 202, 0, 3, 11, 176, 76, 82, 191, 35, 174, 17, 63, 45, 141, 21, 189, 104, 100, 204, 189, 205, 0, 3, 2, 37, 86, 84, 191, 111, 216, 13, 63, 27, 32, 145, 189, 38, 92, 203, 189, 208, 0, 3, 2, 115, 254, 112, 191, 6, 94, 166, 62, 223, 160, 185, 61, 128, 164, 206, 189, 211, 0, 3, 26, 32, 13, 12, 30, 29, 28, 27, 24, 23, 25, 26, 11, 10, 33, 15, 17, 0, 1, 2, 3, 4, 5, 6, 5, 4, 6, 4, 7, 6, 7, 8, 9, 1, 0, 9, 3, 5, 10, 11, 2, 12, 13, 14, 15, 16, 17, 18, 14, 13, 18, 19, 16, 18, 16, 20, 18, 20, 14, 21, 20, 16, 22, 2, 1, 23, 24, 4, 23, 4, 3, 23, 3, 25, 26, 25, 0, 26, 0, 2, 26, 2, 11, 27, 28, 7, 27, 7, 4, 27, 4, 24, 29, 30, 31, 32, 17, 16, 32, 16, 19, 32, 19, 18, 32, 18, 13, 34, 35, 36, 34, 36, 21, 34, 21, 16, 34, 16, 15, 34, 15, 33, 34, 33, 35, 37, 10, 2, 37, 2, 22, 37, 22, 36, 37, 36, 35, 37, 35, 33, 37, 33, 10, 38, 39, 14, 38, 14, 20, 40, 28, 29, 40, 29, 31, 40, 8, 7, 40, 7, 28, 41, 14, 39, 41, 39, 31, 41, 31, 30, 42, 25, 3, 42, 3, 9, 42, 9, 0, 42, 0, 25, 43, 8, 40, 43, 40, 31, 43, 31, 39, 43, 39, 38, 20, 21, 36, 22, 1, 9, 5, 6, 8, 44, 14, 41, 44, 41, 30, 44, 30, 12, 44, 12, 14, 0, 30, 0, 9, 0, 62, 0, 26, 0, 45, 0, 23, 0, 25, 0, 17, 0, 19, 0, 20, 0, 22, 0, 8, 0, 42, 0, 35, 0, 10, 0, 27, 1, 6, 1, 16, 1, 21, 2, 18, 2, 3, 2, 7, 3, 59, 3, 4, 4, 24, 4, 5, 5, 47, 5, 59, 6, 59, 6, 54, 7, 53, 7, 59, 8, 22, 8, 37, 9, 11, 9, 63, 10, 34, 10, 27, 11, 14, 11, 30, 12, 29, 12, 28, 12, 13, 13, 15, 13, 14, 14, 44, 15, 59, 15, 33, 16, 38, 16, 59, 17, 25, 17, 18, 18, 19, 19, 52, 20, 55, 20, 21, 21, 22, 23, 48, 23, 24, 24, 25, 26, 51, 26, 46, 27, 28, 28, 29, 29, 30, 31, 36, 31, 40, 31, 32, 32, 59, 32, 33, 33, 34, 34, 35, 35, 36, 36, 41, 37, 42, 37, 38, 38, 39, 39, 59, 39, 40, 40, 41, 41, 42, 43, 59, 43, 49, 43, 44, 44, 59, 45, 48, 45, 46, 46, 57, 47, 56, 47, 48, 49, 60, 49, 50, 50, 58, 50, 51, 51, 61, 52, 55, 52, 53, 53, 54, 54, 55, 56, 59, 56, 57, 57, 58, 58, 59, 60, 63, 60, 61, 61, 62, 62, 63, 1, 6, 20, 1, 6, 16, 1, 8, 16, 2, 7, 18, 2, 3, 4, 2, 3, 7, 3, 4, 5, 4, 5, 23, 5, 47, 56, 6, 7, 53, 0, 8, 37, 0, 8, 22, 0, 9, 62, 0, 9, 11, 9, 11, 14, 0, 10, 34, 10, 12, 13, 0, 10, 27, 11, 12, 13, 12, 28, 29, 13, 14, 15, 15, 32, 33, 16, 38, 39, 0, 17, 18, 0, 17, 25, 0, 19, 20, 0, 20, 21, 0, 23, 24, 0, 23, 45, 0, 26, 45, 0, 26, 51, 26, 46, 50, 0, 27, 28, 0, 35, 36, 31, 32, 33, 31, 36, 40, 31, 32, 39, 37, 38, 39, 43, 44, 59, 43, 49, 50, 45, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 61, 62, 32, 0, 13, 0, 13, 0, 12, 0, 12, 0, 30, 0, 30, 0, 29, 0, 29, 0, 28, 0, 28, 0, 27, 0, 27, 0, 24, 0, 24, 0, 23, 0, 23, 0, 25, 0, 25, 0, 26, 0, 26, 0, 11, 0, 11, 0, 10, 0, 10, 0, 33, 0, 33, 0, 15, 0, 15, 0, 17, 0, 17, 0, 32, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 3, 0, 4, 0, 4, 0, 5, 0, 5, 0, 3, 0, 6, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 7, 0, 6, 0, 7, 0, 8, 0, 8, 0, 6, 0, 9, 0, 1, 0, 0, 0, 9, 0, 9, 0, 3, 0, 5, 0, 9, 0, 11, 0, 2, 0, 2, 0, 10, 0, 13, 0, 14, 0, 14, 0, 12, 0, 15, 0, 16, 0, 16, 0, 17, 0, 18, 0, 14, 0, 13, 0, 18, 0, 18, 0, 19, 0, 19, 0, 16, 0, 16, 0, 18, 0, 16, 0, 20, 0, 20, 0, 18, 0, 20, 0, 14, 0, 21, 0, 20, 0, 16, 0, 21, 0, 22, 0, 2, 0, 1, 0, 22, 0, 24, 0, 4, 0, 4, 0, 23, 0, 3, 0, 23, 0, 3, 0, 25, 0, 25, 0, 0, 0, 0, 0, 26, 0, 2, 0, 26, 0, 28, 0, 7, 0, 7, 0, 27, 0, 4, 0, 27, 0, 30, 0, 31, 0, 31, 0, 29, 0, 16, 0, 32, 0, 19, 0, 32, 0, 18, 0, 32, 0, 34, 0, 35, 0, 35, 0, 36, 0, 36, 0, 34, 0, 36, 0, 21, 0, 21, 0, 34, 0, 16, 0, 34, 0, 15, 0, 34, 0, 33, 0, 34, 0, 33, 0, 35, 0, 37, 0, 10, 0, 2, 0, 37, 0, 22, 0, 37, 0, 22, 0, 36, 0, 36, 0, 37, 0, 35, 0, 37, 0, 33, 0, 37, 0, 38, 0, 39, 0, 39, 0, 14, 0, 14, 0, 38, 0, 20, 0, 38, 0, 40, 0, 28, 0, 29, 0, 40, 0, 31, 0, 40, 0, 40, 0, 8, 0, 7, 0, 40, 0, 41, 0, 14, 0, 39, 0, 41, 0, 39, 0, 31, 0, 31, 0, 41, 0, 30, 0, 41, 0, 42, 0, 25, 0, 3, 0, 42, 0, 9, 0, 42, 0, 0, 0, 42, 0, 43, 0, 8, 0, 40, 0, 43, 0, 31, 0, 43, 0, 39, 0, 43, 0, 44, 0, 14, 0, 41, 0, 44, 0, 30, 0, 44, 0, 12, 0, 44, 0, 0, 0, 0, 0, 181, 222, 207, 189, 181, 222, 207, 189, 0, 0, 0, 0, 181, 222, 207, 61, 181, 222, 207, 61, 184, 30, 133, 61, 224, 14, 222, 58, 151, 228, 185, 54, 89, 121, 143, 49, 92, 111, 242, 51, 89, 121, 143, 49, 20, 11, 193, 54, 190, 175, 172, 175, 92, 111, 242, 51, 190, 175, 172, 175, 213, 247, 243, 54, 212, 150, 215, 186, 160, 185, 39, 55, 130, 116, 239, 60, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 2, 2, 2, 2, 2, 2, 1, 1, 11, 11, 11, 11, 11, 11, 11, 11, 2, 2, 2, 2, 2, 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, 11, 2, 2, 2, 2, 1, 1, 1, 1, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 1, 1, 1, 1, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 1, 1, 1, 1, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 9, 9, 9, 9, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 42, 42, 42, 42, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 42, 42, 42, 42, 9, 9, 9, 9, 23, 23, 23, 23, 23, 23, 23, 23, 3, 3, 3, 3, 5, 5, 5, 5, 23, 23, 23, 23, 23, 23, 23, 23, 3, 3, 3, 3, 5, 5, 5, 5, 23, 23, 23, 23, 23, 23, 23, 23, 23, 3, 3, 3, 5, 5, 5, 5, 23, 23, 23, 23, 23, 23, 23, 23, 23, 3, 3, 3, 5, 5, 5, 5, 24, 24, 24, 24, 24, 24, 24, 24, 4, 4, 4, 4, 4, 5, 5, 5, 24, 24, 24, 24, 24, 24, 24, 24, 4, 4, 4, 4, 4, 5, 5, 5, 24, 24, 24, 24, 24, 24, 24, 24, 4, 4, 4, 4, 4, 4, 6, 6, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 20, 20, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 20, 20, 20, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 18, 18, 18, 18, 20, 32, 32, 32, 32, 32, 32, 32, 32, 19, 19, 18, 18, 18, 18, 18, 18, 32, 32, 32, 32, 32, 32, 32, 32, 19, 18, 18, 18, 18, 18, 18, 18, 32, 32, 32, 32, 32, 32, 32, 32, 19, 18, 18, 18, 18, 18, 18, 18, 32, 32, 32, 32, 32, 32, 32, 32, 18, 18, 18, 18, 18, 18, 18, 18, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 44, 44, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 44, 44, 44, 14, 14, 14, 14, 14, 30, 30, 30, 30, 30, 30, 30, 30, 41, 41, 41, 41, 14, 14, 14, 14, 30, 30, 30, 30, 30, 30, 30, 30, 41, 41, 41, 41, 41, 39, 39, 39, 30, 30, 30, 30, 30, 30, 30, 30, 41, 41, 41, 41, 41, 39, 39, 39, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 30, 30, 30, 29, 29, 29, 29, 28, 28, 27, 27, 27, 27, 24, 24, 24, 41, 30, 30, 29, 31, 31, 40, 40, 28, 7, 7, 27, 27, 4, 4, 4, 41, 41, 41, 31, 31, 31, 40, 40, 40, 7, 7, 7, 7, 4, 4, 4, 41, 41, 41, 31, 31, 31, 40, 40, 40, 7, 7, 7, 7, 4, 4, 4, 41, 41, 41, 31, 31, 31, 40, 40, 40, 7, 7, 7, 7, 4, 4, 4, 41, 41, 39, 39, 43, 43, 43, 8, 8, 8, 6, 6, 6, 4, 4, 4, 39, 39, 39, 39, 43, 43, 43, 8, 8, 8, 6, 6, 6, 6, 6, 4, 39, 39, 39, 39, 43, 43, 43, 8, 8, 8, 6, 6, 6, 6, 6, 6, 39, 39, 39, 39, 43, 43, 43, 8, 8, 8, 6, 6, 6, 6, 6, 6, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 17, 17, 17, 15, 15, 15, 15, 33, 33, 10, 10, 10, 10, 11, 11, 11, 16, 16, 16, 15, 15, 34, 34, 35, 35, 37, 37, 10, 10, 2, 2, 2, 16, 16, 16, 34, 34, 34, 34, 35, 35, 37, 37, 37, 37, 2, 2, 2, 16, 16, 16, 34, 34, 34, 34, 35, 35, 37, 37, 37, 37, 2, 2, 2, 16, 16, 16, 34, 34, 34, 34, 35, 35, 37, 37, 37, 37, 2, 2, 2, 16, 16, 16, 21, 21, 21, 36, 36, 36, 36, 22, 22, 22, 2, 2, 2, 16, 21, 21, 21, 21, 21, 36, 36, 36, 36, 22, 22, 22, 22, 22, 2, 20, 21, 21, 21, 21, 21, 36, 36, 36, 36, 22, 22, 22, 22, 22, 1, 20, 21, 21, 21, 21, 21, 36, 36, 36, 36, 22, 22, 22, 22, 22, 1, 20, 20, 20, 18, 18, 18, 18, 14, 14, 14, 14, 14, 14, 14, 39, 39, 21, 20, 20, 20, 18, 18, 18, 14, 14, 14, 14, 14, 14, 39, 39, 39, 21, 21, 20, 20, 20, 18, 18, 14, 14, 14, 14, 14, 39, 39, 39, 39, 21, 21, 21, 20, 20, 20, 18, 14, 14, 14, 14, 39, 39, 39, 39, 39, 21, 21, 21, 21, 20, 20, 20, 38, 38, 38, 39, 39, 39, 39, 39, 43, 21, 21, 21, 21, 21, 20, 20, 38, 38, 39, 39, 39, 39, 43, 43, 43, 36, 36, 21, 21, 21, 21, 20, 20, 38, 39, 39, 43, 43, 43, 43, 43, 36, 36, 36, 36, 36, 36, 21, 20, 39, 43, 43, 8, 8, 8, 8, 8, 36, 36, 36, 36, 36, 36, 22, 1, 6, 6, 8, 8, 8, 8, 8, 8, 36, 36, 22, 22, 22, 22, 1, 9, 5, 6, 6, 6, 6, 8, 8, 8, 22, 22, 22, 22, 22, 1, 1, 9, 5, 5, 6, 6, 6, 6, 6, 6, 22, 22, 22, 22, 1, 1, 1, 9, 9, 5, 5, 6, 6, 6, 6, 6, 22, 22, 22, 1, 1, 1, 9, 9, 9, 5, 5, 5, 6, 6, 6, 6, 22, 22, 1, 1, 1, 1, 9, 9, 9, 5, 5, 5, 5, 6, 6, 6, 22, 1, 1, 1, 1, 1, 9, 9, 9, 5, 5, 5, 5, 5, 6, 6, 1, 1, 1, 1, 1, 9, 9, 9, 9, 5, 5, 5, 5, 5, 5, 6, 17, 17, 17, 32, 32, 32, 32, 13, 13, 12, 12, 12, 12, 30, 30, 30, 17, 17, 17, 17, 32, 32, 32, 13, 13, 12, 12, 12, 30, 30, 30, 30, 17, 17, 17, 17, 32, 32, 32, 13, 13, 12, 12, 12, 30, 30, 30, 30, 15, 17, 17, 17, 17, 32, 32, 13, 13, 12, 12, 30, 30, 30, 30, 29, 15, 15, 15, 17, 17, 17, 32, 13, 13, 12, 30, 30, 30, 29, 29, 29, 15, 15, 15, 15, 17, 17, 32, 32, 12, 12, 30, 30, 29, 29, 29, 29, 15, 15, 15, 15, 15, 15, 17, 32, 12, 30, 29, 29, 29, 29, 29, 29, 33, 33, 33, 33, 33, 15, 15, 17, 30, 29, 29, 28, 28, 28, 28, 28, 33, 33, 33, 33, 33, 10, 10, 11, 24, 27, 27, 28, 28, 28, 28, 28, 10, 10, 10, 10, 10, 10, 11, 26, 23, 24, 27, 27, 27, 27, 27, 27, 10, 10, 10, 10, 11, 11, 26, 26, 23, 23, 24, 24, 27, 27, 27, 27, 10, 10, 10, 11, 11, 11, 26, 25, 25, 23, 24, 24, 24, 27, 27, 27, 10, 11, 11, 11, 11, 26, 26, 25, 25, 23, 23, 24, 24, 24, 24, 27, 11, 11, 11, 11, 26, 26, 26, 25, 25, 23, 23, 23, 24, 24, 24, 24, 11, 11, 11, 11, 26, 26, 26, 25, 25, 23, 23, 23, 24, 24, 24, 24, 11, 11, 11, 26, 26, 26, 26, 25, 25, 23, 23, 23, 23, 24, 24, 24, 39, 39, 39, 41, 41, 41, 41, 41, 30, 30, 30, 30, 30, 30, 30, 30, 39, 39, 39, 41, 41, 41, 41, 41, 30, 30, 30, 30, 30, 30, 30, 30, 14, 14, 14, 14, 41, 41, 41, 41, 30, 30, 30, 30, 30, 30, 30, 30, 14, 14, 14, 14, 14, 44, 44, 44, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 44, 44, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 18, 18, 18, 18, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 18, 18, 18, 18, 32, 32, 32, 32, 32, 32, 32, 32, 18, 18, 18, 18, 18, 18, 18, 19, 32, 32, 32, 32, 32, 32, 32, 32, 18, 18, 18, 18, 18, 18, 18, 19, 32, 32, 32, 32, 32, 32, 32, 32, 18, 18, 18, 18, 18, 18, 19, 19, 32, 32, 32, 32, 32, 32, 32, 32, 20, 18, 18, 18, 18, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 20, 20, 20, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 20, 20, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 6, 6, 4, 4, 4, 4, 4, 4, 24, 24, 24, 24, 24, 24, 24, 24, 5, 5, 5, 4, 4, 4, 4, 4, 24, 24, 24, 24, 24, 24, 24, 24, 5, 5, 5, 4, 4, 4, 4, 4, 24, 24, 24, 24, 24, 24, 24, 24, 5, 5, 5, 5, 3, 3, 3, 23, 23, 23, 23, 23, 23, 23, 23, 23, 5, 5, 5, 5, 3, 3, 3, 23, 23, 23, 23, 23, 23, 23, 23, 23, 5, 5, 5, 5, 3, 3, 3, 3, 23, 23, 23, 23, 23, 23, 23, 23, 5, 5, 5, 5, 3, 3, 3, 3, 23, 23, 23, 23, 23, 23, 23, 23, 9, 9, 9, 9, 42, 42, 42, 42, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 42, 42, 42, 42, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 9, 9, 9, 9, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 1, 1, 1, 1, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 1, 1, 1, 1, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 1, 1, 1, 1, 2, 2, 2, 2, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, 2, 2, 2, 2, 2, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 2, 2, 2, 2, 2, 2, 11, 11, 11, 11, 11, 11, 11, 11, 1, 22, 22, 22, 22, 22, 36, 36, 36, 36, 21, 21, 21, 21, 21, 20, 1, 22, 22, 22, 22, 22, 36, 36, 36, 36, 21, 21, 21, 21, 21, 20, 2, 22, 22, 22, 22, 22, 36, 36, 36, 36, 21, 21, 21, 21, 21, 16, 2, 2, 2, 22, 22, 22, 36, 36, 36, 36, 21, 21, 21, 16, 16, 16, 2, 2, 2, 37, 37, 37, 37, 35, 35, 34, 34, 34, 34, 16, 16, 16, 2, 2, 2, 37, 37, 37, 37, 35, 35, 34, 34, 34, 34, 16, 16, 16, 2, 2, 2, 37, 37, 37, 37, 35, 35, 34, 34, 34, 34, 16, 16, 16, 2, 2, 2, 10, 10, 37, 37, 35, 35, 34, 34, 15, 15, 16, 16, 16, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 11, 11, 11, 10, 10, 10, 10, 33, 33, 15, 15, 15, 15, 17, 17, 17, 6, 6, 6, 6, 6, 6, 8, 8, 8, 43, 43, 43, 39, 39, 39, 39, 6, 6, 6, 6, 6, 6, 8, 8, 8, 43, 43, 43, 39, 39, 39, 39, 4, 6, 6, 6, 6, 6, 8, 8, 8, 43, 43, 43, 39, 39, 39, 39, 4, 4, 4, 6, 6, 6, 8, 8, 8, 43, 43, 43, 39, 39, 41, 41, 4, 4, 4, 7, 7, 7, 7, 40, 40, 40, 31, 31, 31, 41, 41, 41, 4, 4, 4, 7, 7, 7, 7, 40, 40, 40, 31, 31, 31, 41, 41, 41, 4, 4, 4, 7, 7, 7, 7, 40, 40, 40, 31, 31, 31, 41, 41, 41, 4, 4, 4, 27, 27, 7, 7, 28, 40, 40, 31, 31, 29, 30, 30, 41, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 30, 24, 24, 24, 23, 23, 23, 23, 25, 25, 26, 26, 26, 26, 11, 11, 11, 24, 24, 24, 24, 23, 23, 23, 25, 25, 26, 26, 26, 11, 11, 11, 11, 24, 24, 24, 24, 23, 23, 23, 25, 25, 26, 26, 26, 11, 11, 11, 11, 27, 24, 24, 24, 24, 23, 23, 25, 25, 26, 26, 11, 11, 11, 11, 10, 27, 27, 27, 24, 24, 24, 23, 25, 25, 26, 11, 11, 11, 10, 10, 10, 27, 27, 27, 27, 24, 24, 23, 23, 26, 26, 11, 11, 10, 10, 10, 10, 27, 27, 27, 27, 27, 27, 24, 23, 26, 11, 10, 10, 10, 10, 10, 10, 28, 28, 28, 28, 28, 27, 27, 24, 11, 10, 10, 33, 33, 33, 33, 33, 28, 28, 28, 28, 28, 29, 29, 30, 17, 15, 15, 33, 33, 33, 33, 33, 29, 29, 29, 29, 29, 29, 30, 12, 32, 17, 15, 15, 15, 15, 15, 15, 29, 29, 29, 29, 30, 30, 12, 12, 32, 32, 17, 17, 15, 15, 15, 15, 29, 29, 29, 30, 30, 30, 12, 13, 13, 32, 17, 17, 17, 15, 15, 15, 29, 30, 30, 30, 30, 12, 12, 13, 13, 32, 32, 17, 17, 17, 17, 15, 30, 30, 30, 30, 12, 12, 12, 13, 13, 32, 32, 32, 17, 17, 17, 17, 30, 30, 30, 30, 12, 12, 12, 13, 13, 32, 32, 32, 17, 17, 17, 17, 30, 30, 30, 12, 12, 12, 12, 13, 13, 32, 32, 32, 32, 17, 17, 17, 6, 5, 5, 5, 5, 5, 5, 9, 9, 9, 9, 1, 1, 1, 1, 1, 6, 6, 5, 5, 5, 5, 5, 9, 9, 9, 1, 1, 1, 1, 1, 22, 6, 6, 6, 5, 5, 5, 5, 9, 9, 9, 1, 1, 1, 1, 22, 22, 6, 6, 6, 6, 5, 5, 5, 9, 9, 9, 1, 1, 1, 22, 22, 22, 6, 6, 6, 6, 6, 5, 5, 9, 9, 1, 1, 1, 22, 22, 22, 22, 6, 6, 6, 6, 6, 6, 5, 5, 9, 1, 1, 22, 22, 22, 22, 22, 8, 8, 8, 6, 6, 6, 6, 5, 9, 1, 22, 22, 22, 22, 36, 36, 8, 8, 8, 8, 8, 8, 6, 6, 1, 22, 36, 36, 36, 36, 36, 36, 8, 8, 8, 8, 8, 43, 43, 39, 20, 21, 36, 36, 36, 36, 36, 36, 43, 43, 43, 43, 43, 39, 39, 38, 20, 20, 21, 21, 21, 21, 36, 36, 43, 43, 43, 39, 39, 39, 39, 38, 38, 20, 20, 21, 21, 21, 21, 21, 43, 39, 39, 39, 39, 39, 38, 38, 38, 20, 20, 20, 21, 21, 21, 21, 39, 39, 39, 39, 39, 14, 14, 14, 14, 18, 20, 20, 20, 21, 21, 21, 39, 39, 39, 39, 14, 14, 14, 14, 14, 18, 18, 20, 20, 20, 21, 21, 39, 39, 39, 14, 14, 14, 14, 14, 14, 18, 18, 18, 20, 20, 20, 21, 39, 39, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18, 18, 20, 20, 20, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 45, 0, 0, 0, 214, 0, 0, 0, 8, 0, 0, 0, 6, 4, 7, 6, 7, 4, 4, 6, 4, 5, 4, 3, 4, 4, 8, 4, 8, 3, 6, 3, 5, 4, 4, 4, 3, 5, 4, 4, 4, 4, 5, 6, 5, 5, 6, 4, 5, 6, 3, 5, 6, 5, 4, 4, 4, 1, 9, 42, 25, 26, 2, 2, 22, 9, 0, 0, 26, 11, 10, 37, 22, 1, 4, 23, 25, 42, 9, 5, 5, 6, 7, 27, 24, 23, 3, 3, 9, 6, 4, 5, 8, 7, 4, 6, 8, 40, 28, 27, 4, 6, 43, 40, 7, 1, 5, 3, 42, 0, 33, 37, 2, 11, 10, 2, 26, 30, 44, 14, 13, 12, 14, 18, 32, 12, 44, 41, 39, 38, 20, 18, 13, 17, 16, 34, 33, 17, 32, 19, 18, 20, 21, 34, 15, 32, 16, 15, 14, 20, 16, 19, 32, 13, 16, 32, 18, 18, 14, 38, 21, 16, 20, 36, 34, 16, 2, 37, 36, 1, 25, 3, 4, 24, 23, 4, 27, 26, 0, 42, 3, 23, 11, 2, 0, 25, 24, 4, 7, 28, 27, 7, 40, 29, 28, 40, 31, 30, 29, 31, 41, 44, 12, 29, 40, 43, 39, 41, 30, 13, 18, 19, 16, 17, 15, 34, 35, 37, 10, 35, 33, 15, 16, 21, 36, 36, 37, 33, 34, 34, 21, 22, 37, 35, 10, 33, 35, 36, 22, 2, 39, 20, 14, 14, 41, 31, 43, 38, 28, 7, 8, 43, 31, 29, 14, 44, 30, 31, 39, 25, 0, 9, 3, 8, 39, 31, 40, 14, 12, 30, 41, 0, 0, 128, 191, 130, 116, 239, 60, 180, 101, 169, 61, 227, 63, 138, 60, 227, 63, 138, 60] + } + } + } + + over "link_1" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "shoulder_2_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 120 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "collisions" + { + over "collisions_1" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 213, 127, 78, 113, 232, 193, 236, 239, 125, 34, 134, 218, 20, 237, 232, 103, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 36, 0, 0, 0, 97, 128, 0, 0, 63, 0, 0, 0, 194, 0, 0, 0, 15, 39, 144, 61, 26, 247, 102, 60, 50, 171, 183, 61, 92, 199, 152, 61, 10, 215, 163, 189, 97, 193, 253, 187, 41, 90, 153, 61, 136, 214, 138, 59, 205, 204, 204, 189, 152, 19, 52, 189, 160, 226, 120, 61, 205, 204, 204, 189, 148, 18, 2, 60, 90, 188, 152, 61, 205, 204, 204, 189, 156, 166, 143, 189, 24, 179, 165, 60, 207, 247, 211, 189, 9, 110, 100, 61, 253, 103, 77, 61, 205, 204, 204, 189, 101, 109, 83, 61, 101, 109, 83, 189, 207, 247, 211, 189, 25, 230, 132, 61, 189, 83, 1, 189, 150, 37, 186, 61, 169, 78, 71, 61, 151, 227, 85, 61, 78, 10, 179, 61, 225, 240, 2, 60, 243, 173, 143, 61, 10, 163, 185, 61, 189, 166, 135, 61, 10, 215, 163, 189, 244, 25, 16, 61, 143, 196, 11, 61, 92, 114, 92, 189, 131, 81, 201, 61, 231, 86, 8, 61, 10, 215, 163, 189, 236, 165, 137, 61, 91, 153, 48, 189, 54, 88, 56, 61, 53, 64, 201, 61, 157, 159, 226, 188, 247, 231, 130, 189, 164, 195, 195, 61, 165, 217, 60, 61, 53, 36, 46, 61, 23, 40, 201, 61, 123, 18, 216, 188, 198, 23, 141, 61, 81, 22, 62, 61, 55, 139, 87, 189, 95, 66, 69, 61, 198, 220, 181, 61, 91, 210, 81, 61, 10, 215, 163, 189, 11, 98, 96, 189, 25, 142, 135, 189, 10, 215, 163, 189, 71, 119, 16, 189, 72, 52, 1, 188, 127, 191, 152, 189, 205, 204, 204, 189, 64, 49, 146, 189, 151, 143, 164, 60, 131, 19, 81, 61, 31, 100, 153, 189, 10, 215, 163, 189, 10, 189, 126, 187, 32, 38, 129, 189, 48, 76, 38, 189, 205, 204, 204, 189, 20, 89, 139, 189, 10, 215, 163, 189, 134, 57, 1, 61, 9, 168, 144, 189, 206, 136, 82, 188, 100, 33, 186, 61, 172, 200, 232, 59, 205, 173, 144, 189, 60, 105, 193, 61, 5, 22, 192, 188, 241, 130, 136, 61, 191, 156, 185, 61, 34, 56, 142, 189, 48, 188, 146, 60, 209, 173, 183, 61, 82, 101, 152, 189, 104, 149, 25, 188, 205, 204, 204, 189, 164, 224, 105, 189, 121, 35, 51, 189, 163, 1, 188, 61, 28, 236, 141, 61, 107, 244, 234, 188, 205, 204, 204, 189, 146, 4, 33, 189, 83, 207, 130, 189, 205, 204, 204, 189, 239, 145, 205, 60, 26, 191, 144, 189, 205, 204, 204, 189, 231, 86, 8, 189, 10, 215, 163, 189, 236, 165, 137, 61, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 9, 215, 163, 189, 0, 0, 8, 4, 86, 224, 127, 63, 58, 45, 175, 60, 20, 205, 184, 60, 248, 215, 148, 189, 8, 0, 3, 30, 218, 8, 226, 188, 155, 77, 212, 61, 214, 133, 126, 191, 180, 0, 219, 189, 11, 0, 3, 12, 210, 87, 108, 63, 59, 192, 196, 62, 97, 113, 247, 58, 99, 134, 144, 189, 14, 0, 3, 23, 141, 155, 153, 61, 42, 192, 255, 60, 95, 39, 127, 191, 91, 229, 215, 189, 17, 0, 3, 14, 201, 54, 162, 60, 246, 116, 9, 61, 59, 206, 127, 191, 74, 90, 210, 189, 20, 0, 3, 12, 167, 70, 155, 60, 174, 0, 24, 61, 20, 199, 127, 191, 44, 153, 210, 189, 23, 0, 3, 12, 115, 79, 123, 63, 82, 157, 233, 189, 131, 70, 28, 62, 176, 63, 166, 189, 26, 0, 3, 30, 213, 37, 94, 63, 51, 16, 254, 62, 206, 193, 224, 60, 176, 116, 144, 189, 29, 0, 3, 23, 220, 226, 232, 62, 13, 250, 99, 63, 52, 249, 242, 59, 179, 228, 141, 189, 32, 0, 3, 23, 186, 74, 207, 62, 148, 4, 106, 63, 222, 198, 172, 60, 80, 226, 141, 189, 35, 0, 3, 23, 194, 187, 118, 63, 89, 209, 65, 190, 84, 72, 64, 62, 3, 72, 175, 189, 38, 0, 3, 5, 98, 200, 18, 63, 212, 135, 28, 191, 97, 154, 11, 63, 188, 63, 217, 189, 41, 0, 3, 3, 162, 94, 6, 63, 194, 113, 40, 191, 169, 58, 10, 63, 218, 232, 217, 189, 44, 0, 3, 3, 199, 108, 31, 189, 85, 119, 246, 188, 166, 176, 127, 63, 188, 171, 201, 189, 47, 0, 3, 7, 63, 217, 5, 60, 172, 185, 140, 62, 172, 33, 118, 63, 253, 26, 218, 189, 50, 0, 3, 21, 3, 171, 12, 58, 185, 125, 69, 58, 249, 255, 127, 63, 213, 69, 201, 189, 53, 0, 3, 5, 47, 149, 130, 62, 77, 101, 253, 188, 64, 104, 119, 63, 67, 203, 215, 189, 56, 0, 3, 5, 46, 209, 162, 62, 130, 93, 87, 188, 14, 176, 114, 63, 64, 148, 219, 189, 59, 0, 3, 5, 40, 195, 52, 63, 66, 0, 223, 62, 195, 237, 14, 63, 254, 231, 216, 189, 62, 0, 3, 24, 40, 150, 175, 62, 55, 46, 40, 63, 245, 225, 43, 63, 210, 164, 224, 189, 65, 0, 3, 33, 115, 29, 136, 189, 123, 93, 127, 63, 248, 177, 189, 60, 179, 136, 146, 189, 68, 0, 3, 1, 218, 168, 131, 190, 155, 82, 119, 63, 146, 107, 186, 188, 198, 9, 148, 189, 71, 0, 3, 1, 136, 201, 23, 191, 1, 9, 78, 63, 71, 97, 217, 60, 252, 26, 148, 189, 74, 0, 3, 1, 169, 25, 53, 63, 25, 249, 28, 191, 212, 250, 179, 190, 242, 29, 214, 189, 77, 0, 3, 18, 17, 73, 133, 188, 100, 188, 126, 191, 48, 134, 200, 189, 25, 79, 172, 189, 80, 0, 3, 10, 48, 177, 84, 191, 147, 120, 14, 63, 167, 121, 121, 186, 204, 65, 144, 189, 83, 0, 3, 1, 137, 252, 86, 191, 203, 249, 10, 63, 78, 249, 204, 187, 122, 115, 144, 189, 86, 0, 3, 1, 50, 227, 103, 191, 69, 159, 174, 190, 100, 179, 128, 190, 202, 210, 196, 189, 89, 0, 3, 0, 28, 46, 118, 191, 172, 97, 78, 190, 21, 140, 62, 62, 3, 12, 179, 189, 92, 0, 3, 2, 0, 211, 127, 191, 43, 149, 139, 60, 123, 193, 6, 61, 115, 59, 150, 189, 95, 0, 3, 2, 136, 85, 185, 62, 21, 195, 55, 191, 58, 64, 24, 63, 182, 37, 224, 189, 98, 0, 3, 3, 222, 152, 10, 188, 182, 205, 87, 190, 185, 61, 122, 63, 115, 109, 219, 189, 101, 0, 3, 4, 111, 66, 226, 189, 181, 1, 126, 63, 202, 138, 107, 61, 120, 109, 151, 189, 104, 0, 3, 19, 52, 141, 9, 191, 207, 250, 86, 63, 250, 218, 159, 61, 135, 237, 154, 189, 107, 0, 3, 1, 122, 172, 223, 190, 49, 1, 32, 63, 109, 156, 37, 63, 126, 96, 226, 189, 110, 0, 3, 7, 228, 2, 40, 189, 9, 5, 187, 62, 61, 20, 110, 63, 212, 115, 224, 189, 113, 0, 3, 21, 178, 240, 94, 191, 60, 4, 249, 62, 134, 160, 145, 61, 104, 193, 154, 189, 116, 0, 3, 1, 210, 111, 127, 191, 48, 115, 38, 61, 93, 141, 86, 61, 182, 4, 153, 189, 119, 0, 3, 2, 180, 26, 182, 190, 89, 26, 77, 61, 173, 234, 110, 63, 151, 215, 223, 189, 122, 0, 3, 2, 99, 48, 25, 191, 137, 42, 181, 62, 116, 5, 56, 63, 52, 30, 230, 189, 125, 0, 3, 7, 129, 23, 105, 191, 136, 118, 169, 190, 213, 195, 125, 190, 167, 221, 195, 189, 128, 0, 3, 0, 246, 224, 127, 191, 76, 28, 221, 60, 214, 37, 114, 60, 82, 199, 148, 189, 131, 0, 3, 1, 40, 103, 125, 191, 192, 68, 17, 62, 176, 35, 0, 188, 95, 186, 149, 189, 134, 0, 3, 1, 245, 115, 103, 190, 130, 69, 168, 189, 123, 124, 120, 191, 232, 207, 234, 189, 137, 0, 3, 16, 17, 254, 7, 191, 104, 7, 46, 191, 232, 113, 1, 63, 234, 18, 218, 189, 140, 0, 3, 6, 30, 211, 34, 190, 215, 187, 63, 189, 111, 117, 124, 63, 83, 49, 208, 189, 143, 0, 3, 2, 107, 127, 45, 190, 36, 131, 56, 189, 250, 8, 124, 63, 70, 241, 208, 189, 146, 0, 3, 2, 211, 136, 90, 191, 192, 218, 185, 190, 133, 61, 191, 62, 199, 143, 202, 189, 149, 0, 3, 6, 211, 172, 68, 63, 219, 37, 10, 191, 203, 75, 176, 190, 237, 63, 211, 189, 152, 0, 3, 18, 253, 171, 123, 62, 29, 173, 42, 189, 29, 235, 119, 191, 188, 169, 235, 189, 155, 0, 3, 14, 121, 158, 121, 63, 188, 72, 41, 190, 17, 138, 23, 190, 52, 103, 178, 189, 158, 0, 3, 29, 112, 240, 154, 190, 81, 68, 99, 191, 36, 150, 177, 190, 154, 134, 211, 189, 161, 0, 3, 10, 231, 61, 34, 191, 255, 146, 37, 191, 144, 62, 217, 190, 122, 134, 222, 189, 164, 0, 3, 9, 126, 205, 129, 189, 5, 120, 132, 189, 185, 242, 126, 191, 177, 133, 217, 189, 167, 0, 3, 16, 184, 26, 0, 189, 42, 27, 89, 189, 196, 131, 127, 191, 253, 220, 213, 189, 170, 0, 3, 16, 245, 40, 225, 188, 66, 34, 165, 189, 199, 17, 127, 191, 216, 208, 216, 189, 173, 0, 3, 16, 207, 230, 248, 62, 250, 188, 65, 191, 69, 186, 223, 190, 120, 4, 224, 189, 176, 0, 3, 28, 143, 113, 232, 61, 178, 67, 117, 191, 122, 183, 134, 190, 100, 101, 198, 189, 179, 0, 3, 28, 119, 90, 208, 60, 114, 216, 91, 190, 24, 242, 121, 191, 246, 86, 232, 189, 182, 0, 3, 14, 0, 0, 0, 0, 13, 27, 114, 191, 25, 98, 166, 62, 195, 173, 199, 189, 185, 0, 3, 4, 46, 171, 22, 190, 154, 6, 89, 191, 253, 114, 2, 63, 91, 17, 219, 189, 188, 0, 3, 4, 34, 220, 2, 191, 254, 75, 51, 191, 58, 16, 255, 62, 46, 43, 218, 189, 191, 0, 3, 6, 35, 25, 23, 20, 19, 1, 11, 13, 0, 1, 2, 3, 4, 5, 6, 0, 2, 6, 2, 7, 6, 7, 5, 6, 5, 4, 8, 1, 0, 9, 0, 6, 9, 6, 4, 9, 4, 10, 11, 1, 8, 11, 8, 12, 11, 12, 13, 14, 15, 12, 16, 10, 14, 16, 14, 12, 16, 12, 8, 16, 8, 0, 16, 0, 9, 16, 9, 10, 17, 10, 4, 17, 4, 3, 17, 3, 18, 19, 7, 1, 19, 20, 21, 22, 18, 3, 22, 3, 5, 23, 24, 20, 23, 25, 26, 23, 26, 22, 27, 13, 12, 27, 12, 15, 28, 10, 17, 28, 17, 18, 28, 18, 14, 28, 14, 10, 29, 18, 22, 29, 22, 26, 29, 26, 14, 29, 14, 18, 30, 24, 23, 30, 23, 22, 30, 22, 5, 30, 5, 24, 31, 25, 15, 31, 15, 14, 31, 14, 26, 31, 26, 25, 32, 1, 7, 32, 7, 2, 32, 2, 1, 33, 21, 20, 33, 20, 24, 33, 24, 5, 33, 5, 7, 33, 7, 21, 34, 7, 19, 34, 19, 21, 34, 21, 7, 35, 13, 27, 35, 27, 15, 35, 15, 25, 0, 62, 0, 29, 0, 28, 0, 25, 0, 24, 0, 11, 0, 13, 0, 60, 1, 7, 1, 51, 1, 3, 2, 22, 2, 6, 2, 27, 3, 8, 3, 4, 4, 50, 4, 5, 5, 55, 5, 6, 6, 9, 7, 11, 7, 18, 8, 19, 8, 9, 9, 10, 10, 21, 10, 20, 11, 12, 12, 17, 12, 13, 13, 31, 14, 46, 14, 32, 14, 16, 15, 20, 15, 36, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 21, 33, 21, 22, 22, 23, 23, 26, 23, 34, 24, 57, 24, 49, 25, 52, 25, 58, 26, 37, 26, 27, 27, 43, 28, 41, 28, 53, 29, 48, 29, 30, 30, 38, 30, 42, 31, 60, 31, 32, 32, 61, 33, 36, 33, 34, 34, 35, 35, 40, 35, 36, 37, 40, 37, 38, 38, 39, 39, 47, 39, 40, 41, 44, 41, 42, 42, 43, 43, 44, 44, 54, 45, 48, 45, 62, 45, 46, 46, 47, 47, 48, 49, 51, 49, 50, 50, 51, 52, 56, 52, 53, 53, 54, 54, 55, 55, 56, 56, 59, 57, 59, 57, 58, 58, 59, 60, 61, 61, 62, 1, 3, 7, 0, 1, 7, 1, 3, 4, 2, 22, 23, 2, 6, 9, 2, 5, 6, 3, 4, 5, 4, 5, 24, 7, 11, 12, 8, 9, 10, 10, 15, 20, 0, 11, 12, 12, 13, 14, 0, 13, 31, 14, 15, 16, 14, 32, 45, 15, 16, 17, 21, 22, 23, 23, 26, 34, 0, 24, 25, 0, 25, 28, 25, 52, 56, 26, 27, 30, 0, 28, 29, 28, 41, 44, 0, 29, 45, 29, 30, 38, 31, 32, 60, 33, 34, 35, 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 50, 51, 52, 53, 54, 57, 58, 59, 0, 60, 61, 35, 0, 25, 0, 25, 0, 23, 0, 23, 0, 20, 0, 20, 0, 19, 0, 19, 0, 1, 0, 1, 0, 11, 0, 11, 0, 13, 0, 13, 0, 35, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 3, 0, 4, 0, 4, 0, 5, 0, 5, 0, 3, 0, 6, 0, 0, 0, 2, 0, 6, 0, 2, 0, 7, 0, 7, 0, 6, 0, 7, 0, 5, 0, 5, 0, 6, 0, 4, 0, 6, 0, 8, 0, 1, 0, 0, 0, 8, 0, 9, 0, 0, 0, 6, 0, 9, 0, 4, 0, 9, 0, 4, 0, 10, 0, 10, 0, 9, 0, 8, 0, 11, 0, 8, 0, 12, 0, 12, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 15, 0, 12, 0, 12, 0, 14, 0, 16, 0, 10, 0, 10, 0, 14, 0, 14, 0, 16, 0, 12, 0, 16, 0, 8, 0, 16, 0, 0, 0, 16, 0, 9, 0, 16, 0, 17, 0, 10, 0, 4, 0, 17, 0, 3, 0, 17, 0, 3, 0, 18, 0, 18, 0, 17, 0, 19, 0, 7, 0, 7, 0, 1, 0, 20, 0, 21, 0, 21, 0, 19, 0, 22, 0, 18, 0, 3, 0, 22, 0, 5, 0, 22, 0, 23, 0, 24, 0, 24, 0, 20, 0, 25, 0, 26, 0, 26, 0, 23, 0, 26, 0, 22, 0, 22, 0, 23, 0, 27, 0, 13, 0, 12, 0, 27, 0, 15, 0, 27, 0, 28, 0, 10, 0, 17, 0, 28, 0, 18, 0, 28, 0, 18, 0, 14, 0, 14, 0, 28, 0, 29, 0, 18, 0, 22, 0, 29, 0, 26, 0, 29, 0, 26, 0, 14, 0, 14, 0, 29, 0, 30, 0, 24, 0, 23, 0, 30, 0, 22, 0, 30, 0, 5, 0, 30, 0, 5, 0, 24, 0, 31, 0, 25, 0, 25, 0, 15, 0, 15, 0, 31, 0, 14, 0, 31, 0, 26, 0, 31, 0, 32, 0, 1, 0, 7, 0, 32, 0, 2, 0, 32, 0, 33, 0, 21, 0, 20, 0, 33, 0, 24, 0, 33, 0, 5, 0, 33, 0, 7, 0, 33, 0, 7, 0, 21, 0, 34, 0, 7, 0, 19, 0, 34, 0, 21, 0, 34, 0, 27, 0, 35, 0, 15, 0, 35, 0, 0, 0, 0, 0, 31, 100, 153, 189, 10, 215, 163, 189, 207, 247, 211, 189, 41, 90, 153, 61, 90, 188, 152, 61, 131, 81, 201, 61, 41, 132, 114, 59, 123, 167, 146, 55, 23, 105, 193, 50, 13, 79, 225, 50, 23, 105, 193, 50, 166, 243, 141, 55, 232, 126, 212, 179, 13, 79, 225, 50, 232, 126, 212, 179, 193, 245, 64, 55, 80, 180, 160, 185, 185, 30, 15, 188, 152, 9, 123, 187, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 7, 7, 7, 7, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, 8, 7, 7, 7, 7, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 8, 8, 7, 7, 7, 7, 7, 1, 1, 1, 1, 11, 11, 11, 11, 8, 8, 8, 32, 32, 32, 32, 32, 1, 1, 1, 1, 11, 11, 11, 8, 8, 8, 8, 32, 32, 32, 32, 32, 32, 1, 1, 1, 11, 11, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, 32, 1, 1, 1, 11, 8, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, 32, 32, 1, 1, 8, 8, 8, 8, 8, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 0, 0, 16, 16, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 16, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 24, 24, 24, 20, 20, 20, 23, 23, 23, 25, 25, 25, 25, 25, 31, 31, 24, 24, 24, 24, 20, 20, 23, 23, 23, 25, 25, 25, 25, 31, 31, 31, 24, 24, 24, 24, 20, 20, 23, 23, 23, 25, 25, 25, 25, 31, 31, 31, 24, 24, 24, 24, 24, 20, 23, 23, 23, 25, 25, 25, 31, 31, 31, 31, 24, 24, 24, 24, 24, 24, 23, 23, 23, 25, 25, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 23, 23, 23, 25, 25, 26, 26, 26, 26, 26, 30, 30, 30, 30, 30, 30, 30, 23, 23, 26, 26, 26, 26, 26, 26, 26, 30, 30, 30, 30, 30, 30, 30, 30, 23, 26, 26, 26, 26, 26, 26, 26, 5, 5, 5, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 26, 26, 26, 5, 5, 5, 5, 5, 5, 5, 5, 29, 29, 29, 29, 29, 29, 29, 29, 5, 5, 5, 5, 5, 5, 5, 5, 22, 29, 29, 29, 29, 29, 29, 29, 5, 5, 5, 5, 5, 5, 5, 5, 22, 29, 29, 29, 29, 29, 29, 29, 5, 5, 5, 5, 5, 5, 5, 5, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 18, 18, 18, 17, 17, 17, 28, 10, 10, 10, 10, 9, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 9, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 10, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 10, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 10, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 10, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 10, 9, 9, 9, 9, 18, 18, 18, 28, 28, 28, 28, 10, 10, 10, 10, 10, 9, 9, 9, 9, 24, 33, 33, 33, 33, 21, 21, 21, 21, 34, 34, 34, 7, 7, 7, 7, 24, 33, 33, 33, 33, 21, 21, 21, 21, 34, 34, 34, 34, 7, 7, 7, 24, 33, 33, 33, 33, 21, 21, 21, 21, 34, 34, 34, 34, 7, 7, 7, 20, 20, 33, 33, 33, 21, 21, 21, 21, 34, 34, 34, 34, 7, 7, 7, 20, 20, 20, 20, 33, 21, 21, 21, 21, 34, 34, 19, 19, 19, 19, 1, 20, 20, 20, 20, 20, 20, 21, 21, 21, 34, 19, 19, 19, 1, 1, 1, 23, 23, 23, 20, 20, 20, 20, 21, 19, 19, 19, 1, 1, 1, 1, 1, 23, 23, 23, 23, 23, 23, 20, 20, 19, 1, 1, 1, 1, 1, 1, 1, 23, 23, 23, 23, 23, 25, 25, 35, 11, 11, 11, 1, 1, 1, 1, 1, 25, 25, 25, 25, 25, 25, 35, 35, 13, 11, 11, 11, 11, 11, 11, 11, 25, 25, 25, 25, 25, 35, 35, 35, 13, 13, 11, 11, 11, 11, 11, 11, 25, 25, 25, 25, 35, 35, 35, 27, 27, 13, 13, 11, 11, 11, 11, 11, 25, 25, 25, 35, 35, 35, 35, 27, 27, 27, 13, 13, 11, 11, 11, 11, 25, 25, 15, 15, 15, 15, 15, 27, 27, 27, 27, 13, 13, 11, 11, 11, 31, 31, 15, 15, 15, 15, 15, 27, 27, 27, 27, 27, 12, 12, 12, 11, 31, 31, 15, 15, 15, 15, 15, 27, 27, 27, 27, 27, 12, 12, 12, 8, 31, 31, 31, 31, 31, 26, 26, 26, 26, 29, 29, 29, 18, 18, 18, 18, 31, 31, 31, 31, 31, 26, 26, 26, 26, 29, 29, 29, 18, 18, 18, 18, 15, 31, 31, 31, 31, 31, 26, 26, 26, 29, 29, 14, 14, 14, 18, 18, 15, 15, 15, 31, 31, 31, 26, 26, 29, 29, 14, 14, 14, 14, 14, 28, 15, 15, 15, 15, 31, 31, 31, 26, 29, 14, 14, 14, 14, 14, 28, 28, 15, 15, 15, 15, 15, 15, 31, 26, 14, 14, 14, 14, 14, 28, 28, 28, 15, 15, 15, 15, 15, 15, 15, 31, 14, 14, 14, 14, 28, 28, 28, 28, 27, 27, 27, 27, 15, 15, 15, 15, 14, 14, 14, 28, 10, 10, 10, 10, 27, 27, 27, 27, 27, 12, 12, 12, 16, 16, 16, 10, 10, 10, 10, 10, 27, 27, 27, 27, 12, 12, 12, 12, 16, 16, 16, 16, 10, 10, 10, 10, 27, 27, 12, 12, 12, 12, 12, 8, 16, 16, 16, 16, 16, 16, 10, 10, 27, 12, 12, 12, 12, 12, 8, 8, 0, 16, 16, 16, 16, 16, 16, 10, 12, 12, 12, 12, 8, 8, 8, 8, 0, 0, 16, 16, 16, 16, 16, 9, 12, 12, 12, 8, 8, 8, 8, 8, 0, 0, 16, 16, 16, 16, 16, 9, 12, 12, 8, 8, 8, 8, 8, 0, 0, 0, 0, 16, 16, 16, 16, 9, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 16, 16, 9, 9, 24, 24, 24, 24, 24, 30, 30, 30, 5, 5, 5, 5, 5, 3, 3, 3, 33, 24, 24, 24, 24, 24, 30, 30, 5, 5, 5, 5, 5, 3, 3, 3, 33, 33, 24, 24, 24, 24, 30, 30, 5, 5, 5, 5, 3, 3, 3, 3, 33, 33, 33, 24, 24, 24, 30, 30, 5, 5, 5, 5, 3, 3, 3, 3, 33, 33, 33, 33, 24, 24, 24, 30, 5, 5, 5, 3, 3, 3, 3, 3, 21, 33, 33, 33, 33, 24, 24, 5, 5, 5, 3, 3, 3, 3, 3, 3, 21, 21, 21, 21, 33, 33, 24, 5, 5, 5, 3, 3, 3, 3, 4, 4, 21, 21, 21, 21, 21, 21, 21, 24, 5, 3, 4, 4, 4, 4, 4, 4, 21, 21, 21, 21, 34, 34, 7, 7, 6, 4, 4, 4, 4, 4, 4, 4, 34, 34, 34, 34, 34, 7, 7, 7, 2, 6, 6, 4, 4, 4, 4, 4, 34, 34, 34, 7, 7, 7, 7, 32, 2, 6, 6, 6, 6, 4, 4, 4, 34, 34, 7, 7, 7, 7, 32, 2, 2, 6, 6, 6, 6, 6, 6, 4, 7, 7, 7, 7, 7, 7, 32, 2, 2, 2, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 32, 32, 2, 2, 2, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 32, 32, 32, 2, 2, 2, 2, 6, 6, 6, 6, 6, 7, 7, 7, 32, 32, 32, 32, 2, 2, 2, 2, 6, 6, 6, 6, 6, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 5, 5, 5, 5, 5, 5, 5, 5, 29, 29, 29, 29, 29, 29, 29, 22, 5, 5, 5, 5, 5, 5, 5, 5, 29, 29, 29, 29, 29, 29, 29, 22, 5, 5, 5, 5, 5, 5, 5, 5, 29, 29, 29, 29, 29, 29, 29, 29, 5, 5, 5, 5, 5, 5, 5, 5, 26, 26, 26, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 5, 5, 5, 26, 26, 26, 26, 26, 26, 26, 23, 30, 30, 30, 30, 30, 30, 30, 30, 26, 26, 26, 26, 26, 26, 26, 23, 23, 30, 30, 30, 30, 30, 30, 30, 26, 26, 26, 26, 26, 25, 25, 23, 23, 23, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 25, 25, 23, 23, 23, 24, 24, 24, 24, 24, 24, 31, 31, 31, 31, 25, 25, 25, 23, 23, 23, 20, 24, 24, 24, 24, 24, 31, 31, 31, 25, 25, 25, 25, 23, 23, 23, 20, 20, 24, 24, 24, 24, 31, 31, 31, 25, 25, 25, 25, 23, 23, 23, 20, 20, 24, 24, 24, 24, 31, 31, 25, 25, 25, 25, 25, 23, 23, 23, 20, 20, 20, 24, 24, 24, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 16, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 16, 16, 0, 0, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 8, 8, 8, 8, 8, 8, 8, 1, 1, 32, 32, 32, 32, 32, 32, 32, 8, 8, 8, 8, 8, 8, 11, 1, 1, 1, 32, 32, 32, 32, 32, 32, 8, 8, 8, 8, 8, 11, 11, 1, 1, 1, 32, 32, 32, 32, 32, 32, 8, 8, 8, 8, 11, 11, 11, 1, 1, 1, 1, 32, 32, 32, 32, 32, 8, 8, 8, 11, 11, 11, 11, 1, 1, 1, 1, 7, 7, 7, 7, 7, 8, 8, 11, 11, 11, 11, 11, 1, 1, 1, 1, 1, 7, 7, 7, 7, 8, 11, 11, 11, 11, 11, 11, 1, 1, 1, 1, 1, 7, 7, 7, 7, 8, 12, 12, 12, 27, 27, 27, 27, 27, 15, 15, 15, 15, 15, 31, 31, 11, 12, 12, 12, 27, 27, 27, 27, 27, 15, 15, 15, 15, 15, 31, 31, 11, 11, 11, 13, 13, 27, 27, 27, 27, 15, 15, 15, 15, 15, 25, 25, 11, 11, 11, 11, 13, 13, 27, 27, 27, 35, 35, 35, 35, 25, 25, 25, 11, 11, 11, 11, 11, 13, 13, 27, 27, 35, 35, 35, 25, 25, 25, 25, 11, 11, 11, 11, 11, 11, 13, 13, 35, 35, 35, 25, 25, 25, 25, 25, 11, 11, 11, 11, 11, 11, 11, 13, 35, 35, 25, 25, 25, 25, 25, 25, 1, 1, 1, 1, 1, 11, 11, 11, 35, 25, 25, 23, 23, 23, 23, 23, 1, 1, 1, 1, 1, 1, 1, 19, 20, 20, 23, 23, 23, 23, 23, 23, 1, 1, 1, 1, 1, 19, 19, 19, 21, 20, 20, 20, 20, 23, 23, 23, 1, 1, 1, 19, 19, 19, 34, 21, 21, 21, 20, 20, 20, 20, 20, 20, 1, 19, 19, 19, 19, 34, 34, 21, 21, 21, 21, 33, 20, 20, 20, 20, 7, 7, 7, 34, 34, 34, 34, 21, 21, 21, 21, 33, 33, 33, 20, 20, 7, 7, 7, 34, 34, 34, 34, 21, 21, 21, 21, 33, 33, 33, 33, 24, 7, 7, 7, 34, 34, 34, 34, 21, 21, 21, 21, 33, 33, 33, 33, 24, 7, 7, 7, 7, 34, 34, 34, 21, 21, 21, 21, 33, 33, 33, 33, 24, 9, 9, 9, 9, 10, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 10, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 10, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 10, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 10, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 10, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 9, 10, 10, 10, 10, 28, 28, 28, 28, 18, 18, 18, 9, 9, 9, 9, 9, 10, 10, 10, 10, 28, 17, 17, 17, 18, 18, 18, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 2, 2, 2, 2, 32, 32, 32, 32, 7, 7, 7, 6, 6, 6, 6, 6, 2, 2, 2, 2, 32, 32, 32, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 2, 2, 2, 32, 32, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 2, 2, 2, 32, 7, 7, 7, 7, 7, 7, 4, 6, 6, 6, 6, 6, 6, 2, 2, 32, 7, 7, 7, 7, 34, 34, 4, 4, 4, 6, 6, 6, 6, 2, 32, 7, 7, 7, 7, 34, 34, 34, 4, 4, 4, 4, 4, 6, 6, 2, 7, 7, 7, 34, 34, 34, 34, 34, 4, 4, 4, 4, 4, 4, 4, 6, 7, 7, 34, 34, 21, 21, 21, 21, 4, 4, 4, 4, 4, 4, 3, 5, 24, 21, 21, 21, 21, 21, 21, 21, 4, 4, 3, 3, 3, 3, 5, 5, 5, 24, 33, 33, 21, 21, 21, 21, 3, 3, 3, 3, 3, 3, 5, 5, 5, 24, 24, 33, 33, 33, 33, 21, 3, 3, 3, 3, 3, 5, 5, 5, 30, 24, 24, 24, 33, 33, 33, 33, 3, 3, 3, 3, 5, 5, 5, 5, 30, 30, 24, 24, 24, 33, 33, 33, 3, 3, 3, 3, 5, 5, 5, 5, 30, 30, 24, 24, 24, 24, 33, 33, 3, 3, 3, 5, 5, 5, 5, 5, 30, 30, 24, 24, 24, 24, 24, 33, 3, 3, 3, 5, 5, 5, 5, 5, 30, 30, 30, 24, 24, 24, 24, 24, 9, 9, 16, 16, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 9, 16, 16, 16, 16, 0, 0, 0, 0, 8, 8, 8, 8, 8, 12, 12, 9, 16, 16, 16, 16, 16, 0, 0, 8, 8, 8, 8, 8, 12, 12, 12, 9, 16, 16, 16, 16, 16, 0, 0, 8, 8, 8, 8, 12, 12, 12, 12, 10, 16, 16, 16, 16, 16, 16, 0, 8, 8, 12, 12, 12, 12, 12, 27, 10, 10, 16, 16, 16, 16, 16, 16, 8, 12, 12, 12, 12, 12, 27, 27, 10, 10, 10, 10, 16, 16, 16, 16, 12, 12, 12, 12, 27, 27, 27, 27, 10, 10, 10, 10, 10, 16, 16, 16, 12, 12, 12, 27, 27, 27, 27, 27, 10, 10, 10, 10, 28, 14, 14, 14, 15, 15, 15, 15, 27, 27, 27, 27, 28, 28, 28, 28, 14, 14, 14, 14, 31, 15, 15, 15, 15, 15, 15, 15, 28, 28, 28, 14, 14, 14, 14, 14, 26, 31, 15, 15, 15, 15, 15, 15, 28, 28, 14, 14, 14, 14, 14, 29, 26, 31, 31, 31, 15, 15, 15, 15, 28, 14, 14, 14, 14, 14, 29, 29, 26, 26, 31, 31, 31, 15, 15, 15, 18, 18, 14, 14, 14, 29, 29, 26, 26, 26, 31, 31, 31, 31, 31, 15, 18, 18, 18, 18, 29, 29, 29, 26, 26, 26, 26, 31, 31, 31, 31, 31, 18, 18, 18, 18, 29, 29, 29, 26, 26, 26, 26, 31, 31, 31, 31, 31, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 36, 0, 0, 0, 194, 0, 0, 0, 9, 0, 0, 0, 6, 7, 5, 5, 6, 8, 6, 9, 5, 5, 6, 4, 7, 4, 9, 6, 6, 5, 6, 5, 5, 5, 7, 6, 5, 5, 6, 4, 4, 4, 4, 4, 3, 5, 3, 4, 1, 8, 16, 9, 6, 2, 11, 8, 0, 2, 32, 7, 19, 0, 6, 7, 32, 1, 4, 17, 18, 22, 5, 5, 6, 9, 10, 17, 3, 3, 22, 30, 24, 33, 7, 6, 4, 0, 9, 4, 5, 7, 2, 6, 5, 33, 21, 34, 19, 1, 32, 2, 1, 11, 12, 16, 0, 0, 16, 10, 4, 6, 9, 16, 14, 28, 17, 4, 13, 12, 8, 1, 11, 13, 27, 15, 14, 16, 8, 35, 27, 12, 11, 15, 31, 26, 29, 18, 28, 10, 16, 12, 12, 27, 35, 25, 31, 14, 10, 9, 0, 8, 12, 14, 10, 28, 18, 3, 4, 17, 28, 14, 29, 22, 3, 1, 7, 34, 21, 20, 19, 21, 33, 24, 23, 19, 34, 7, 33, 20, 18, 29, 26, 23, 30, 5, 3, 20, 24, 30, 22, 26, 25, 20, 33, 5, 30, 23, 23, 26, 31, 15, 35, 23, 22, 29, 14, 31, 25, 13, 35, 15, 12, 10, 14, 18, 17, 18, 14, 26, 22, 24, 5, 22, 23, 25, 26, 14, 15, 1, 2, 7, 21, 7, 5, 24, 20, 7, 21, 19, 25, 15, 27, 13, 0, 0, 128, 191, 50, 243, 145, 61, 113, 135, 40, 61, 113, 135, 40, 61, 233, 86, 198, 61] + } + } + } + + over "link_2" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "elbow_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "collisions" + { + over "collisions_2" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 227, 95, 88, 102, 194, 36, 165, 235, 168, 215, 240, 174, 238, 26, 243, 148, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 34, 0, 0, 0, 96, 128, 0, 0, 64, 0, 0, 0, 192, 0, 0, 0, 243, 187, 49, 63, 99, 117, 1, 188, 227, 188, 201, 189, 254, 238, 178, 60, 250, 80, 154, 61, 190, 187, 156, 189, 52, 27, 74, 59, 182, 97, 156, 189, 15, 217, 156, 189, 17, 135, 38, 63, 159, 214, 109, 189, 36, 42, 131, 190, 37, 79, 101, 188, 21, 49, 147, 189, 100, 122, 140, 190, 215, 246, 38, 63, 30, 52, 109, 189, 174, 186, 201, 189, 56, 196, 49, 63, 16, 117, 146, 187, 33, 221, 130, 190, 216, 82, 50, 63, 27, 96, 23, 60, 212, 1, 76, 190, 55, 244, 67, 189, 208, 64, 120, 189, 9, 172, 156, 189, 189, 202, 44, 63, 87, 165, 53, 61, 208, 253, 130, 190, 211, 190, 21, 60, 102, 214, 147, 61, 223, 211, 141, 190, 14, 127, 35, 63, 164, 19, 118, 61, 240, 210, 130, 190, 234, 123, 80, 189, 165, 241, 81, 61, 127, 53, 142, 190, 251, 213, 113, 189, 190, 66, 36, 189, 230, 112, 139, 190, 188, 75, 138, 189, 150, 86, 184, 60, 26, 239, 139, 190, 85, 91, 7, 189, 9, 155, 138, 61, 175, 179, 156, 189, 37, 246, 71, 189, 60, 62, 109, 61, 7, 92, 188, 189, 215, 229, 41, 63, 111, 50, 86, 61, 187, 186, 201, 189, 116, 145, 45, 63, 23, 136, 42, 61, 28, 13, 224, 189, 126, 52, 34, 63, 232, 170, 112, 61, 143, 65, 224, 189, 248, 116, 45, 63, 252, 120, 56, 189, 29, 138, 64, 190, 67, 139, 127, 189, 234, 200, 48, 61, 22, 173, 156, 189, 33, 231, 154, 189, 224, 12, 27, 186, 217, 172, 156, 189, 52, 233, 154, 189, 168, 115, 15, 187, 246, 120, 67, 190, 207, 155, 44, 63, 27, 157, 50, 189, 102, 67, 131, 190, 215, 171, 48, 63, 8, 18, 206, 60, 104, 188, 201, 189, 4, 129, 47, 63, 55, 205, 11, 189, 245, 11, 224, 189, 220, 179, 144, 189, 83, 244, 88, 188, 61, 14, 136, 190, 61, 237, 144, 189, 180, 115, 226, 188, 158, 9, 18, 190, 38, 160, 92, 188, 82, 17, 150, 61, 160, 254, 110, 190, 34, 85, 140, 189, 65, 254, 255, 188, 38, 211, 163, 189, 70, 108, 52, 189, 189, 232, 123, 189, 129, 162, 95, 190, 73, 139, 75, 188, 204, 68, 144, 61, 148, 15, 141, 190, 166, 225, 36, 60, 134, 175, 158, 61, 170, 106, 122, 190, 153, 149, 3, 61, 215, 59, 142, 187, 142, 221, 127, 63, 62, 226, 155, 61, 0, 0, 3, 12, 134, 153, 175, 60, 56, 221, 127, 191, 37, 236, 200, 188, 242, 71, 160, 189, 3, 0, 3, 1, 57, 230, 232, 60, 128, 229, 127, 191, 248, 237, 48, 58, 100, 100, 156, 189, 6, 0, 3, 33, 51, 132, 13, 61, 22, 105, 237, 188, 84, 189, 127, 63, 36, 240, 151, 61, 9, 0, 3, 12, 22, 55, 125, 63, 228, 155, 22, 190, 169, 132, 30, 187, 198, 40, 48, 191, 12, 0, 3, 22, 201, 127, 198, 58, 168, 181, 17, 186, 235, 255, 127, 63, 78, 192, 156, 61, 15, 0, 3, 12, 76, 70, 151, 190, 175, 145, 116, 191, 2, 165, 123, 59, 59, 238, 146, 189, 18, 0, 3, 11, 96, 12, 108, 63, 72, 152, 187, 62, 8, 103, 255, 189, 23, 167, 43, 191, 21, 0, 3, 30, 164, 112, 3, 61, 156, 70, 251, 59, 82, 220, 127, 191, 26, 47, 142, 190, 24, 0, 3, 22, 185, 39, 19, 61, 251, 44, 212, 61, 205, 116, 126, 191, 52, 248, 144, 190, 27, 0, 3, 8, 150, 239, 162, 60, 235, 253, 175, 188, 232, 227, 127, 191, 224, 16, 141, 190, 30, 0, 3, 21, 130, 72, 166, 189, 199, 157, 83, 189, 207, 207, 126, 191, 27, 79, 142, 190, 33, 0, 3, 25, 88, 195, 67, 190, 169, 233, 39, 189, 33, 15, 123, 191, 222, 94, 143, 190, 36, 0, 3, 25, 84, 10, 2, 191, 228, 106, 92, 63, 2, 111, 206, 188, 236, 170, 157, 189, 39, 0, 3, 5, 60, 15, 25, 63, 10, 52, 77, 63, 183, 16, 34, 59, 68, 127, 224, 190, 42, 0, 3, 8, 100, 108, 203, 62, 5, 226, 106, 63, 212, 197, 145, 188, 213, 119, 160, 190, 45, 0, 3, 8, 167, 144, 81, 62, 105, 140, 122, 63, 7, 109, 130, 60, 57, 226, 61, 190, 48, 0, 3, 4, 102, 94, 63, 61, 42, 105, 105, 63, 156, 236, 208, 62, 220, 170, 29, 189, 51, 0, 3, 4, 185, 32, 226, 62, 85, 173, 101, 191, 173, 72, 127, 187, 147, 71, 174, 190, 54, 0, 3, 15, 106, 8, 169, 183, 247, 81, 138, 55, 0, 0, 128, 63, 14, 172, 156, 61, 57, 0, 3, 12, 152, 122, 161, 57, 192, 15, 131, 56, 0, 0, 128, 63, 192, 181, 156, 61, 60, 0, 3, 12, 231, 36, 131, 57, 90, 73, 96, 57, 255, 255, 127, 63, 109, 176, 156, 61, 63, 0, 3, 12, 44, 210, 33, 191, 52, 175, 65, 63, 201, 104, 43, 62, 249, 212, 114, 189, 66, 0, 3, 24, 202, 130, 62, 191, 122, 244, 42, 63, 225, 244, 127, 188, 174, 143, 156, 189, 69, 0, 3, 20, 53, 5, 94, 191, 125, 114, 254, 62, 140, 213, 241, 188, 163, 93, 159, 189, 72, 0, 3, 26, 221, 169, 116, 191, 5, 165, 150, 62, 72, 84, 194, 187, 239, 12, 149, 189, 75, 0, 3, 0, 72, 3, 117, 191, 151, 95, 148, 62, 16, 134, 131, 187, 78, 136, 148, 189, 78, 0, 3, 0, 112, 103, 99, 63, 2, 153, 233, 190, 254, 130, 87, 189, 204, 223, 33, 191, 81, 0, 3, 21, 78, 235, 4, 63, 217, 130, 90, 191, 253, 70, 48, 189, 203, 242, 203, 190, 84, 0, 3, 15, 84, 1, 234, 60, 246, 174, 118, 189, 64, 110, 127, 191, 90, 45, 142, 190, 87, 0, 3, 15, 123, 179, 221, 60, 140, 102, 185, 188, 53, 215, 127, 191, 142, 7, 141, 190, 90, 0, 3, 21, 26, 153, 1, 61, 122, 105, 110, 59, 192, 222, 127, 191, 199, 9, 142, 190, 93, 0, 3, 22, 236, 113, 49, 63, 44, 253, 44, 63, 51, 112, 128, 62, 7, 248, 240, 190, 96, 0, 3, 13, 109, 27, 17, 61, 215, 252, 12, 61, 0, 176, 127, 63, 70, 165, 149, 61, 99, 0, 3, 12, 75, 225, 7, 61, 243, 160, 135, 59, 93, 219, 127, 63, 230, 133, 154, 61, 102, 0, 3, 12, 139, 194, 125, 63, 21, 252, 254, 61, 4, 154, 51, 61, 71, 210, 46, 191, 105, 0, 3, 23, 145, 19, 94, 63, 243, 109, 254, 62, 228, 222, 187, 188, 203, 9, 29, 191, 108, 0, 3, 30, 94, 174, 78, 63, 85, 13, 23, 63, 232, 130, 189, 187, 173, 148, 18, 191, 111, 0, 3, 8, 166, 63, 23, 63, 177, 30, 78, 191, 209, 82, 83, 61, 172, 143, 218, 190, 114, 0, 3, 12, 87, 37, 103, 63, 161, 113, 219, 190, 62, 156, 4, 189, 215, 29, 35, 191, 117, 0, 3, 21, 101, 35, 115, 63, 138, 55, 160, 190, 7, 6, 199, 187, 60, 151, 41, 191, 120, 0, 3, 21, 0, 228, 14, 63, 202, 97, 240, 190, 165, 34, 47, 63, 124, 206, 165, 190, 123, 0, 3, 12, 78, 98, 40, 191, 91, 23, 206, 189, 148, 25, 63, 191, 140, 20, 124, 190, 126, 0, 3, 25, 24, 154, 126, 191, 165, 249, 144, 61, 64, 16, 157, 189, 202, 186, 183, 189, 129, 0, 3, 0, 181, 168, 123, 191, 227, 193, 59, 190, 63, 9, 42, 59, 126, 23, 152, 189, 132, 0, 3, 7, 227, 89, 120, 191, 12, 168, 118, 190, 48, 224, 237, 188, 225, 182, 162, 189, 135, 0, 3, 25, 212, 197, 107, 191, 87, 18, 198, 190, 112, 179, 60, 189, 43, 213, 168, 189, 138, 0, 3, 25, 108, 62, 78, 191, 218, 153, 23, 191, 139, 118, 130, 188, 156, 239, 154, 189, 141, 0, 3, 25, 10, 99, 246, 190, 170, 73, 96, 63, 145, 250, 235, 188, 166, 132, 158, 189, 144, 0, 3, 5, 174, 44, 121, 191, 77, 211, 105, 190, 222, 232, 177, 60, 152, 165, 147, 189, 147, 0, 3, 7, 245, 58, 81, 191, 61, 129, 19, 191, 148, 194, 127, 187, 141, 53, 152, 189, 150, 0, 3, 25, 120, 195, 221, 190, 80, 99, 77, 190, 119, 244, 96, 63, 131, 173, 12, 61, 153, 0, 3, 9, 94, 44, 76, 191, 237, 93, 26, 191, 33, 133, 143, 188, 255, 187, 155, 189, 156, 0, 3, 18, 122, 225, 18, 191, 21, 172, 77, 191, 104, 5, 35, 190, 72, 40, 224, 189, 159, 0, 3, 17, 32, 123, 169, 190, 23, 145, 113, 191, 129, 179, 62, 187, 46, 4, 150, 189, 162, 0, 3, 17, 212, 55, 226, 190, 119, 239, 100, 63, 19, 136, 145, 189, 118, 90, 180, 189, 165, 0, 3, 5, 40, 169, 183, 189, 220, 15, 149, 62, 3, 213, 115, 191, 80, 109, 145, 190, 168, 0, 3, 5, 233, 214, 226, 60, 21, 227, 127, 63, 239, 36, 48, 60, 71, 205, 153, 189, 171, 0, 3, 2, 40, 43, 228, 60, 75, 227, 127, 63, 204, 224, 35, 60, 66, 46, 154, 189, 174, 0, 3, 2, 95, 172, 200, 60, 195, 141, 124, 63, 33, 145, 37, 190, 67, 8, 238, 189, 177, 0, 3, 2, 181, 50, 185, 189, 13, 186, 123, 63, 124, 173, 33, 190, 178, 63, 233, 189, 180, 0, 3, 5, 201, 254, 84, 190, 193, 190, 121, 63, 144, 222, 144, 189, 237, 242, 185, 189, 183, 0, 3, 5, 169, 171, 45, 190, 19, 68, 124, 63, 251, 41, 101, 60, 207, 222, 145, 189, 186, 0, 3, 3, 20, 178, 13, 190, 32, 121, 125, 63, 119, 118, 182, 60, 186, 28, 143, 189, 189, 0, 3, 3, 0, 1, 2, 3, 2, 4, 5, 2, 3, 5, 0, 2, 6, 7, 0, 8, 2, 1, 8, 4, 2, 9, 7, 6, 9, 6, 10, 9, 10, 11, 12, 10, 4, 12, 4, 13, 12, 13, 14, 15, 12, 16, 17, 18, 9, 17, 9, 11, 17, 11, 19, 17, 19, 1, 20, 5, 3, 21, 22, 8, 21, 8, 1, 21, 1, 15, 21, 15, 16, 21, 16, 12, 21, 12, 14, 21, 14, 23, 21, 23, 22, 24, 6, 20, 24, 20, 3, 24, 3, 4, 24, 4, 10, 24, 10, 6, 25, 18, 17, 25, 17, 1, 25, 1, 0, 25, 0, 7, 25, 7, 9, 25, 9, 18, 26, 5, 20, 26, 20, 6, 26, 6, 0, 26, 0, 5, 27, 14, 13, 27, 23, 14, 28, 22, 23, 28, 23, 27, 28, 27, 13, 28, 13, 8, 29, 12, 15, 30, 22, 28, 30, 28, 8, 30, 8, 22, 31, 8, 13, 31, 13, 4, 31, 4, 8, 32, 12, 29, 32, 10, 12, 33, 1, 19, 33, 19, 11, 33, 11, 10, 33, 10, 32, 33, 32, 29, 33, 29, 15, 33, 15, 1, 0, 34, 0, 5, 0, 3, 1, 2, 1, 6, 1, 29, 2, 3, 2, 18, 3, 41, 4, 7, 4, 35, 4, 40, 5, 6, 5, 20, 6, 54, 7, 36, 7, 8, 8, 31, 8, 9, 9, 59, 9, 15, 10, 56, 10, 30, 10, 11, 11, 53, 11, 12, 12, 42, 12, 24, 13, 48, 13, 23, 13, 22, 14, 32, 14, 37, 14, 15, 15, 16, 16, 58, 16, 17, 17, 57, 17, 33, 18, 38, 18, 28, 19, 26, 19, 51, 19, 20, 20, 21, 21, 63, 21, 22, 22, 23, 23, 24, 24, 25, 25, 43, 25, 26, 26, 44, 27, 31, 27, 39, 27, 28, 28, 29, 29, 30, 30, 31, 32, 37, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 38, 41, 38, 39, 39, 40, 40, 41, 42, 43, 42, 46, 43, 45, 44, 49, 44, 45, 45, 46, 46, 47, 47, 52, 47, 50, 48, 55, 48, 62, 49, 51, 49, 50, 50, 51, 52, 54, 52, 53, 53, 54, 55, 56, 55, 61, 56, 60, 57, 63, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 0, 3, 4, 0, 5, 17, 0, 1, 2, 1, 2, 18, 1, 6, 10, 2, 3, 18, 4, 7, 8, 4, 7, 35, 5, 6, 19, 7, 8, 9, 8, 9, 10, 9, 15, 16, 10, 11, 12, 11, 12, 42, 12, 24, 25, 13, 21, 22, 13, 22, 23, 14, 15, 16, 14, 32, 37, 16, 17, 57, 18, 27, 28, 19, 20, 21, 19, 26, 44, 25, 26, 43, 27, 28, 29, 32, 33, 34, 38, 39, 40, 42, 43, 45, 44, 45, 46, 48, 55, 61, 49, 50, 51, 52, 53, 54, 55, 56, 60, 57, 58, 59, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 3, 0, 2, 0, 2, 0, 4, 0, 4, 0, 3, 0, 5, 0, 2, 0, 3, 0, 5, 0, 5, 0, 0, 0, 6, 0, 7, 0, 7, 0, 0, 0, 0, 0, 6, 0, 8, 0, 2, 0, 1, 0, 8, 0, 8, 0, 4, 0, 9, 0, 7, 0, 6, 0, 9, 0, 6, 0, 10, 0, 10, 0, 9, 0, 10, 0, 11, 0, 11, 0, 9, 0, 12, 0, 10, 0, 10, 0, 4, 0, 4, 0, 12, 0, 4, 0, 13, 0, 13, 0, 12, 0, 13, 0, 14, 0, 14, 0, 12, 0, 15, 0, 12, 0, 12, 0, 16, 0, 16, 0, 15, 0, 17, 0, 18, 0, 18, 0, 9, 0, 9, 0, 17, 0, 11, 0, 17, 0, 11, 0, 19, 0, 19, 0, 17, 0, 19, 0, 1, 0, 1, 0, 17, 0, 20, 0, 5, 0, 3, 0, 20, 0, 21, 0, 22, 0, 22, 0, 8, 0, 8, 0, 21, 0, 1, 0, 21, 0, 1, 0, 15, 0, 15, 0, 21, 0, 16, 0, 21, 0, 12, 0, 21, 0, 14, 0, 21, 0, 14, 0, 23, 0, 23, 0, 21, 0, 23, 0, 22, 0, 24, 0, 6, 0, 6, 0, 20, 0, 20, 0, 24, 0, 3, 0, 24, 0, 4, 0, 24, 0, 10, 0, 24, 0, 25, 0, 18, 0, 17, 0, 25, 0, 1, 0, 25, 0, 0, 0, 25, 0, 7, 0, 25, 0, 9, 0, 25, 0, 26, 0, 5, 0, 20, 0, 26, 0, 6, 0, 26, 0, 0, 0, 26, 0, 27, 0, 14, 0, 13, 0, 27, 0, 27, 0, 23, 0, 28, 0, 22, 0, 23, 0, 28, 0, 27, 0, 28, 0, 13, 0, 28, 0, 13, 0, 8, 0, 8, 0, 28, 0, 29, 0, 12, 0, 15, 0, 29, 0, 30, 0, 22, 0, 28, 0, 30, 0, 8, 0, 30, 0, 31, 0, 8, 0, 13, 0, 31, 0, 4, 0, 31, 0, 32, 0, 12, 0, 29, 0, 32, 0, 32, 0, 10, 0, 33, 0, 1, 0, 19, 0, 33, 0, 11, 0, 33, 0, 10, 0, 33, 0, 32, 0, 33, 0, 29, 0, 33, 0, 15, 0, 33, 0, 0, 0, 0, 0, 48, 233, 154, 189, 182, 97, 156, 189, 127, 53, 142, 190, 216, 82, 50, 63, 134, 175, 158, 61, 8, 172, 156, 189, 86, 91, 147, 60, 50, 126, 38, 58, 174, 142, 65, 182, 68, 11, 106, 58, 174, 142, 65, 182, 69, 58, 57, 59, 203, 151, 67, 54, 68, 11, 106, 58, 203, 151, 67, 54, 170, 30, 19, 59, 153, 192, 143, 62, 120, 22, 63, 58, 22, 114, 52, 190, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 24, 24, 24, 24, 24, 24, 24, 20, 26, 26, 26, 26, 26, 26, 26, 5, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, 26, 0, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 26, 26, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 7, 25, 25, 25, 25, 25, 25, 25, 25, 6, 6, 6, 6, 6, 6, 6, 7, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 7, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 9, 18, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 17, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 31, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 30, 30, 30, 30, 30, 30, 30, 8, 13, 13, 13, 13, 13, 13, 13, 13, 30, 30, 30, 30, 30, 30, 30, 30, 13, 13, 13, 13, 13, 27, 27, 27, 30, 30, 30, 30, 30, 30, 30, 22, 13, 27, 27, 27, 27, 27, 27, 27, 22, 22, 22, 22, 22, 22, 22, 22, 14, 14, 14, 27, 27, 27, 27, 27, 22, 22, 22, 22, 22, 22, 22, 22, 14, 14, 14, 14, 14, 14, 14, 23, 22, 22, 22, 22, 22, 22, 22, 22, 14, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 14, 14, 14, 14, 14, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 16, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 12, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 12, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 12, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 32, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 32, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 32, 32, 32, 10, 11, 11, 11, 9, 9, 9, 9, 9, 12, 12, 12, 12, 29, 29, 33, 33, 11, 11, 11, 9, 9, 9, 9, 9, 16, 16, 16, 15, 15, 15, 15, 1, 19, 17, 17, 17, 17, 17, 18, 18, 21, 21, 15, 15, 15, 15, 15, 1, 19, 17, 17, 17, 17, 17, 17, 18, 21, 21, 15, 15, 15, 15, 15, 1, 19, 17, 17, 17, 17, 17, 17, 18, 21, 21, 15, 15, 15, 15, 15, 1, 17, 17, 17, 17, 17, 17, 17, 17, 21, 21, 15, 15, 15, 15, 15, 1, 17, 17, 17, 17, 17, 17, 17, 17, 21, 21, 15, 15, 15, 15, 15, 1, 17, 17, 17, 17, 17, 17, 17, 17, 21, 21, 15, 15, 15, 15, 15, 1, 17, 17, 17, 17, 17, 17, 17, 17, 21, 21, 15, 15, 15, 15, 15, 1, 1, 17, 17, 17, 17, 17, 17, 17, 13, 13, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 13, 13, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 13, 13, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 13, 13, 13, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 13, 13, 13, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 13, 13, 13, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 13, 13, 13, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 24, 31, 31, 31, 31, 4, 4, 4, 4, 3, 3, 3, 3, 3, 24, 24, 20, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 26, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 26, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 26, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 26, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 5, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 5, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 5, 26, 8, 8, 8, 8, 8, 8, 2, 2, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 30, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 8, 8, 8, 8, 30, 30, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 8, 8, 8, 8, 8, 30, 22, 22, 22, 22, 21, 21, 21, 21, 21, 15, 8, 8, 8, 8, 8, 8, 22, 22, 22, 21, 21, 21, 21, 15, 15, 15, 8, 8, 8, 8, 8, 8, 22, 22, 22, 21, 21, 21, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 22, 22, 21, 21, 15, 15, 15, 15, 15, 2, 2, 2, 8, 8, 8, 8, 22, 21, 21, 15, 15, 15, 15, 15, 15, 2, 2, 2, 2, 2, 2, 8, 8, 21, 15, 15, 15, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 1, 5, 5, 5, 5, 5, 5, 5, 0, 25, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 0, 0, 25, 25, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 0, 0, 0, 25, 25, 25, 17, 17, 17, 17, 17, 5, 5, 5, 5, 0, 0, 0, 0, 0, 25, 25, 25, 17, 17, 17, 17, 5, 5, 5, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 17, 17, 17, 5, 5, 26, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 17, 17, 5, 26, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 17, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 12, 12, 12, 12, 12, 4, 13, 13, 13, 13, 13, 13, 14, 14, 14, 12, 12, 12, 12, 12, 12, 4, 4, 13, 13, 13, 13, 13, 14, 14, 12, 12, 12, 12, 12, 12, 12, 4, 4, 4, 4, 13, 13, 13, 14, 14, 12, 12, 12, 12, 12, 12, 12, 4, 4, 4, 4, 4, 13, 13, 13, 12, 12, 12, 12, 12, 12, 32, 32, 4, 4, 4, 4, 4, 4, 13, 13, 12, 12, 12, 12, 32, 32, 32, 32, 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 10, 10, 10, 10, 10, 10, 3, 3, 3, 3, 3, 3, 3, 24, 9, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 24, 24, 6, 6, 9, 9, 9, 11, 11, 11, 11, 3, 3, 3, 3, 24, 24, 24, 6, 6, 9, 9, 9, 9, 9, 11, 11, 3, 3, 24, 24, 24, 24, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 3, 24, 24, 24, 24, 24, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 24, 24, 24, 24, 24, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 24, 24, 24, 24, 24, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 24, 24, 24, 24, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 21, 21, 21, 21, 21, 21, 21, 16, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 14, 14, 14, 14, 14, 12, 12, 12, 21, 21, 21, 21, 21, 21, 21, 21, 14, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 14, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 23, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 27, 27, 27, 27, 27, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 27, 27, 27, 27, 27, 27, 27, 13, 22, 30, 30, 30, 30, 30, 30, 30, 27, 27, 27, 13, 13, 13, 13, 13, 30, 30, 30, 30, 30, 30, 30, 30, 13, 13, 13, 13, 13, 13, 13, 13, 8, 30, 30, 30, 30, 30, 30, 30, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 31, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 18, 18, 18, 9, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 18, 9, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 7, 9, 9, 9, 9, 9, 9, 9, 25, 25, 25, 25, 25, 25, 25, 25, 7, 6, 6, 6, 6, 6, 6, 6, 25, 25, 25, 25, 25, 25, 25, 25, 7, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 26, 26, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 26, 26, 26, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 0, 26, 26, 26, 26, 26, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 5, 26, 26, 26, 26, 26, 26, 26, 20, 24, 24, 24, 24, 24, 24, 24, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 5, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 5, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 5, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 26, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 26, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 26, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 26, 26, 5, 5, 5, 5, 5, 5, 2, 2, 8, 8, 8, 8, 8, 8, 20, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 31, 31, 31, 31, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 13, 13, 13, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 13, 13, 13, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 13, 13, 13, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 13, 13, 13, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 13, 13, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 13, 13, 24, 24, 24, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 13, 13, 17, 17, 17, 17, 17, 17, 17, 1, 1, 15, 15, 15, 15, 15, 21, 21, 17, 17, 17, 17, 17, 17, 17, 17, 1, 15, 15, 15, 15, 15, 21, 21, 17, 17, 17, 17, 17, 17, 17, 17, 1, 15, 15, 15, 15, 15, 21, 21, 17, 17, 17, 17, 17, 17, 17, 17, 1, 15, 15, 15, 15, 15, 21, 21, 17, 17, 17, 17, 17, 17, 17, 17, 1, 15, 15, 15, 15, 15, 21, 21, 18, 17, 17, 17, 17, 17, 17, 19, 1, 15, 15, 15, 15, 15, 21, 21, 18, 17, 17, 17, 17, 17, 17, 19, 1, 15, 15, 15, 15, 15, 21, 21, 18, 18, 17, 17, 17, 17, 17, 19, 1, 15, 15, 15, 15, 16, 16, 16, 9, 9, 9, 9, 9, 11, 11, 11, 33, 33, 29, 29, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 32, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 32, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 32, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 12, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 12, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 12, 12, 12, 12, 12, 9, 9, 9, 9, 9, 11, 11, 11, 10, 32, 32, 12, 12, 12, 12, 12, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 24, 24, 24, 24, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 24, 24, 24, 24, 24, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 24, 24, 24, 24, 24, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 24, 24, 24, 24, 24, 3, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 24, 24, 24, 24, 3, 3, 11, 11, 9, 9, 9, 9, 9, 6, 6, 24, 24, 24, 3, 3, 3, 3, 11, 11, 11, 11, 9, 9, 9, 6, 6, 24, 24, 3, 3, 3, 3, 3, 11, 11, 11, 11, 11, 11, 11, 9, 24, 3, 3, 3, 3, 3, 3, 3, 10, 10, 10, 10, 10, 10, 12, 12, 4, 4, 4, 4, 4, 4, 4, 4, 32, 32, 32, 32, 12, 12, 12, 12, 13, 13, 4, 4, 4, 4, 4, 4, 32, 32, 12, 12, 12, 12, 12, 12, 13, 13, 13, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 14, 14, 13, 13, 13, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 14, 14, 13, 13, 13, 13, 13, 4, 4, 12, 12, 12, 12, 12, 12, 14, 14, 14, 13, 13, 13, 13, 13, 13, 4, 12, 12, 12, 12, 12, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 17, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 26, 5, 17, 17, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 26, 5, 5, 17, 17, 17, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 5, 5, 5, 17, 17, 17, 17, 25, 25, 25, 0, 0, 0, 0, 0, 5, 5, 5, 5, 17, 17, 17, 17, 17, 25, 25, 25, 0, 0, 0, 5, 5, 5, 5, 5, 17, 17, 17, 17, 17, 17, 25, 25, 0, 0, 5, 5, 5, 5, 5, 5, 17, 17, 17, 17, 17, 17, 17, 25, 0, 5, 5, 5, 5, 5, 5, 5, 1, 17, 17, 17, 17, 17, 17, 17, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 15, 15, 15, 21, 8, 8, 2, 2, 2, 2, 2, 2, 15, 15, 15, 15, 15, 15, 21, 21, 22, 8, 8, 8, 8, 2, 2, 2, 15, 15, 15, 15, 15, 21, 21, 22, 22, 8, 8, 8, 8, 8, 8, 8, 15, 15, 15, 15, 21, 21, 21, 22, 22, 22, 8, 8, 8, 8, 8, 8, 15, 15, 15, 21, 21, 21, 21, 22, 22, 22, 8, 8, 8, 8, 8, 8, 15, 21, 21, 21, 21, 21, 22, 22, 22, 22, 30, 8, 8, 8, 8, 8, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 30, 30, 8, 8, 8, 8, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 30, 8, 8, 8, 8, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 34, 0, 0, 0, 192, 0, 0, 0, 9, 0, 0, 0, 7, 9, 6, 5, 8, 5, 7, 4, 9, 7, 8, 5, 9, 7, 5, 6, 3, 6, 3, 4, 5, 8, 5, 5, 5, 6, 4, 4, 6, 4, 3, 3, 4, 7, 1, 25, 7, 6, 26, 5, 2, 2, 8, 21, 15, 33, 19, 17, 25, 0, 0, 5, 3, 4, 8, 1, 2, 5, 20, 24, 4, 3, 24, 10, 12, 13, 31, 8, 2, 2, 0, 26, 20, 3, 7, 9, 10, 24, 20, 26, 0, 0, 25, 9, 6, 2, 4, 31, 13, 28, 30, 22, 21, 1, 7, 25, 18, 17, 11, 10, 6, 9, 11, 33, 32, 12, 4, 24, 6, 9, 17, 19, 33, 10, 10, 32, 29, 15, 16, 21, 14, 13, 4, 12, 14, 27, 28, 8, 31, 4, 12, 21, 23, 27, 13, 12, 29, 33, 1, 21, 16, 15, 21, 12, 18, 25, 1, 19, 11, 9, 9, 25, 17, 17, 1, 33, 11, 5, 26, 6, 24, 3, 22, 23, 14, 12, 16, 15, 1, 8, 8, 30, 28, 23, 21, 21, 22, 28, 27, 14, 6, 10, 4, 3, 20, 18, 9, 7, 0, 1, 17, 5, 0, 6, 20, 14, 23, 28, 13, 22, 30, 8, 13, 27, 23, 12, 32, 33, 15, 22, 8, 28, 8, 4, 13, 12, 10, 33, 29, 1, 15, 29, 32, 10, 11, 19, 0, 0, 128, 191, 114, 68, 140, 61, 173, 29, 174, 62, 128, 247, 33, 61, 128, 247, 33, 61] + } + } + } + + over "link_3" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "wrist_1_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "collisions" + { + over "collisions_3" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 61, 215, 58, 243, 230, 160, 138, 117, 82, 188, 113, 39, 252, 15, 108, 106, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 34, 0, 0, 0, 96, 128, 0, 0, 64, 0, 0, 0, 192, 0, 0, 0, 51, 3, 14, 63, 197, 90, 52, 61, 155, 194, 131, 59, 23, 247, 16, 63, 6, 233, 44, 61, 250, 209, 222, 189, 145, 171, 139, 56, 168, 2, 114, 61, 110, 111, 206, 189, 203, 161, 29, 189, 39, 192, 59, 61, 47, 112, 206, 189, 152, 192, 25, 63, 44, 137, 217, 59, 104, 190, 222, 189, 250, 84, 26, 63, 93, 131, 86, 186, 168, 54, 28, 189, 20, 87, 23, 63, 250, 98, 220, 188, 138, 208, 222, 189, 74, 176, 13, 63, 50, 105, 50, 189, 22, 210, 222, 189, 15, 198, 17, 63, 153, 246, 43, 189, 203, 138, 246, 59, 146, 19, 160, 188, 155, 71, 100, 189, 232, 108, 206, 189, 79, 155, 76, 189, 45, 210, 73, 60, 234, 52, 117, 189, 130, 62, 199, 188, 154, 118, 4, 61, 228, 11, 46, 189, 131, 179, 23, 63, 165, 201, 206, 60, 7, 228, 144, 59, 238, 178, 25, 63, 154, 162, 6, 59, 79, 84, 213, 59, 248, 206, 21, 63, 221, 133, 21, 61, 114, 122, 31, 189, 155, 0, 62, 189, 4, 20, 25, 189, 54, 112, 206, 189, 206, 239, 35, 189, 132, 251, 39, 189, 216, 67, 170, 189, 189, 162, 112, 189, 58, 212, 6, 188, 165, 111, 206, 189, 175, 5, 44, 59, 104, 164, 82, 61, 205, 247, 118, 189, 234, 30, 48, 61, 175, 252, 235, 60, 141, 118, 142, 188, 32, 134, 22, 63, 129, 126, 247, 188, 19, 253, 154, 59, 159, 207, 142, 188, 243, 237, 9, 189, 252, 12, 30, 189, 99, 213, 21, 189, 242, 196, 150, 188, 210, 98, 51, 189, 136, 110, 139, 186, 212, 144, 16, 187, 45, 197, 128, 188, 236, 149, 101, 189, 212, 54, 166, 60, 148, 111, 206, 189, 127, 248, 21, 63, 20, 126, 5, 61, 134, 206, 222, 189, 252, 174, 7, 189, 212, 58, 217, 183, 0, 240, 13, 189, 11, 139, 53, 61, 253, 60, 176, 188, 57, 113, 78, 188, 198, 208, 28, 61, 179, 211, 181, 58, 110, 247, 2, 188, 140, 90, 6, 61, 0, 148, 39, 189, 142, 246, 0, 189, 7, 84, 80, 189, 86, 40, 197, 188, 114, 90, 155, 189, 183, 2, 219, 187, 246, 221, 153, 60, 247, 132, 183, 188, 84, 17, 135, 188, 208, 44, 80, 189, 9, 28, 141, 189, 15, 174, 18, 63, 158, 175, 37, 61, 212, 30, 217, 59, 223, 112, 242, 60, 176, 221, 127, 63, 29, 58, 86, 188, 74, 74, 119, 189, 0, 0, 3, 9, 117, 208, 84, 188, 115, 70, 27, 61, 93, 203, 127, 191, 218, 218, 210, 189, 3, 0, 3, 8, 162, 7, 118, 63, 31, 51, 138, 190, 39, 240, 114, 189, 251, 244, 20, 191, 6, 0, 3, 24, 175, 56, 175, 60, 84, 237, 127, 191, 17, 148, 45, 60, 249, 32, 94, 189, 9, 0, 3, 2, 4, 74, 173, 56, 48, 16, 38, 183, 255, 255, 127, 191, 72, 234, 222, 189, 12, 0, 3, 8, 67, 179, 206, 62, 177, 243, 105, 191, 151, 47, 48, 189, 237, 45, 137, 190, 15, 0, 3, 3, 173, 66, 53, 191, 246, 106, 33, 63, 150, 201, 162, 62, 98, 114, 197, 188, 18, 0, 3, 6, 226, 72, 114, 63, 135, 137, 164, 62, 135, 254, 1, 61, 181, 175, 17, 191, 21, 0, 3, 17, 69, 56, 111, 63, 119, 70, 182, 62, 117, 21, 250, 59, 23, 17, 16, 191, 24, 0, 3, 17, 12, 118, 94, 63, 226, 38, 253, 62, 119, 215, 161, 188, 217, 255, 6, 191, 27, 0, 3, 15, 130, 110, 16, 191, 148, 49, 83, 191, 205, 116, 8, 61, 71, 186, 91, 189, 30, 0, 3, 14, 170, 105, 91, 188, 210, 235, 184, 187, 20, 249, 127, 191, 230, 30, 208, 189, 33, 0, 3, 8, 4, 210, 93, 188, 185, 253, 164, 188, 179, 236, 127, 191, 141, 52, 209, 189, 36, 0, 3, 33, 234, 53, 52, 190, 51, 243, 74, 63, 1, 100, 21, 63, 4, 214, 167, 187, 39, 0, 3, 7, 102, 14, 63, 189, 60, 103, 93, 63, 2, 236, 255, 62, 238, 232, 104, 188, 42, 0, 3, 7, 15, 252, 11, 188, 62, 130, 123, 63, 253, 196, 62, 62, 91, 216, 32, 189, 45, 0, 3, 9, 209, 45, 163, 190, 233, 110, 109, 63, 71, 47, 72, 62, 120, 168, 15, 189, 48, 0, 3, 7, 36, 228, 210, 190, 117, 85, 92, 63, 39, 60, 153, 62, 179, 231, 205, 188, 51, 0, 3, 6, 155, 238, 109, 63, 5, 6, 185, 190, 20, 8, 153, 61, 34, 201, 14, 191, 54, 0, 3, 24, 202, 137, 113, 62, 226, 37, 19, 190, 160, 10, 118, 63, 8, 31, 23, 190, 57, 0, 3, 24, 139, 221, 8, 63, 245, 83, 88, 191, 6, 139, 29, 188, 82, 255, 173, 190, 60, 0, 3, 3, 137, 64, 102, 63, 138, 177, 223, 190, 234, 55, 77, 60, 97, 199, 10, 191, 63, 0, 3, 24, 152, 199, 33, 191, 219, 147, 37, 191, 203, 155, 218, 62, 190, 180, 133, 188, 66, 0, 3, 25, 242, 220, 248, 190, 3, 4, 171, 190, 77, 189, 78, 63, 174, 112, 59, 60, 69, 0, 3, 25, 25, 101, 123, 191, 139, 62, 190, 61, 77, 86, 40, 62, 150, 77, 37, 189, 72, 0, 3, 4, 121, 111, 77, 191, 242, 66, 13, 63, 188, 118, 104, 62, 109, 94, 8, 189, 75, 0, 3, 6, 27, 204, 87, 188, 177, 164, 19, 60, 169, 247, 127, 191, 199, 75, 208, 189, 78, 0, 3, 8, 19, 184, 83, 188, 128, 16, 253, 58, 105, 250, 127, 191, 92, 251, 207, 189, 81, 0, 3, 8, 82, 234, 84, 188, 237, 180, 161, 58, 107, 250, 127, 191, 25, 246, 207, 189, 84, 0, 3, 8, 62, 220, 225, 62, 180, 112, 101, 63, 197, 70, 61, 189, 240, 215, 149, 190, 87, 0, 3, 9, 72, 113, 94, 63, 68, 55, 253, 62, 75, 105, 162, 188, 137, 253, 6, 191, 90, 0, 3, 15, 5, 206, 42, 59, 179, 190, 156, 57, 200, 255, 127, 191, 239, 243, 225, 189, 93, 0, 3, 8, 14, 59, 202, 57, 23, 65, 208, 56, 254, 255, 127, 191, 174, 70, 223, 189, 96, 0, 3, 8, 71, 138, 255, 190, 160, 44, 158, 190, 36, 66, 79, 63, 50, 164, 60, 60, 99, 0, 3, 25, 154, 14, 50, 191, 185, 54, 175, 62, 252, 186, 33, 63, 32, 80, 149, 186, 102, 0, 3, 6, 156, 107, 89, 191, 252, 121, 201, 189, 76, 199, 4, 63, 34, 131, 38, 188, 105, 0, 3, 4, 108, 90, 42, 190, 119, 25, 114, 190, 192, 17, 117, 63, 137, 25, 107, 60, 108, 0, 3, 25, 115, 33, 133, 190, 181, 112, 243, 190, 63, 38, 87, 63, 92, 186, 66, 60, 111, 0, 3, 25, 61, 121, 73, 190, 83, 21, 31, 191, 159, 36, 66, 63, 180, 204, 160, 59, 114, 0, 3, 1, 77, 89, 95, 189, 84, 0, 46, 191, 115, 65, 59, 63, 8, 228, 67, 187, 117, 0, 3, 1, 91, 167, 58, 189, 92, 138, 85, 190, 143, 25, 122, 63, 156, 69, 33, 60, 120, 0, 3, 1, 175, 116, 107, 191, 24, 191, 199, 190, 142, 169, 48, 61, 215, 170, 88, 189, 123, 0, 3, 4, 234, 223, 75, 191, 233, 202, 20, 191, 183, 51, 43, 62, 63, 66, 43, 189, 126, 0, 3, 25, 147, 161, 45, 191, 57, 36, 28, 191, 174, 214, 209, 62, 199, 42, 148, 188, 129, 0, 3, 25, 238, 204, 99, 191, 2, 186, 40, 190, 57, 215, 217, 62, 110, 218, 138, 188, 132, 0, 3, 4, 46, 222, 118, 191, 65, 9, 176, 189, 40, 48, 128, 62, 72, 148, 3, 189, 135, 0, 3, 4, 22, 39, 21, 191, 236, 211, 172, 62, 110, 68, 61, 63, 216, 93, 207, 59, 138, 0, 3, 6, 194, 42, 254, 190, 219, 61, 15, 62, 41, 83, 91, 63, 82, 12, 89, 60, 141, 0, 3, 6, 121, 77, 85, 190, 52, 147, 123, 62, 77, 91, 114, 63, 78, 16, 121, 60, 144, 0, 3, 6, 3, 188, 38, 190, 234, 137, 176, 62, 114, 168, 108, 63, 153, 94, 87, 60, 147, 0, 3, 6, 9, 121, 88, 190, 3, 202, 54, 63, 210, 221, 42, 63, 128, 125, 6, 57, 150, 0, 3, 7, 6, 190, 67, 190, 128, 91, 91, 191, 79, 36, 245, 62, 214, 166, 96, 188, 153, 0, 3, 1, 246, 64, 12, 191, 148, 62, 60, 191, 124, 62, 204, 62, 200, 253, 154, 188, 156, 0, 3, 25, 31, 219, 239, 190, 27, 136, 93, 191, 2, 76, 54, 62, 168, 138, 33, 189, 159, 0, 3, 25, 190, 128, 163, 187, 218, 255, 124, 191, 37, 61, 28, 62, 10, 3, 35, 189, 162, 0, 3, 2, 127, 145, 184, 188, 97, 107, 117, 191, 168, 55, 145, 62, 84, 24, 242, 188, 165, 0, 3, 2, 121, 235, 77, 189, 9, 146, 208, 62, 10, 113, 105, 63, 176, 240, 205, 59, 168, 0, 3, 7, 244, 180, 76, 189, 80, 182, 169, 62, 47, 48, 113, 63, 62, 52, 19, 60, 171, 0, 3, 7, 240, 31, 231, 188, 39, 57, 70, 60, 30, 225, 127, 63, 186, 83, 20, 60, 174, 0, 3, 6, 195, 112, 150, 60, 13, 127, 37, 60, 155, 241, 127, 63, 36, 208, 143, 188, 177, 0, 3, 15, 175, 188, 113, 62, 91, 170, 41, 62, 27, 31, 117, 63, 19, 222, 23, 190, 180, 0, 3, 15, 148, 220, 29, 63, 76, 249, 71, 63, 90, 48, 200, 61, 196, 104, 197, 190, 183, 0, 3, 15, 82, 160, 152, 62, 42, 92, 116, 63, 240, 206, 49, 187, 118, 107, 86, 190, 186, 0, 3, 9, 142, 210, 68, 62, 132, 57, 123, 63, 25, 191, 123, 59, 174, 114, 25, 190, 189, 0, 3, 9, 0, 1, 2, 3, 2, 1, 4, 5, 6, 7, 8, 9, 7, 1, 6, 7, 6, 8, 10, 11, 3, 12, 13, 5, 12, 5, 4, 12, 4, 14, 15, 9, 16, 15, 17, 7, 15, 7, 9, 18, 11, 19, 18, 19, 0, 18, 0, 2, 18, 2, 3, 18, 3, 11, 20, 5, 13, 20, 13, 8, 20, 8, 6, 20, 6, 5, 21, 22, 16, 21, 23, 22, 24, 17, 10, 24, 10, 3, 24, 3, 1, 24, 1, 7, 24, 7, 17, 25, 1, 14, 25, 14, 4, 25, 4, 6, 25, 6, 1, 26, 22, 23, 26, 11, 10, 26, 10, 22, 27, 28, 23, 27, 23, 21, 27, 21, 29, 27, 29, 8, 27, 8, 28, 30, 17, 15, 30, 15, 16, 30, 16, 22, 30, 22, 10, 30, 10, 17, 31, 11, 26, 31, 26, 23, 31, 23, 28, 31, 28, 19, 31, 19, 11, 32, 29, 21, 32, 21, 16, 32, 16, 9, 32, 9, 8, 32, 8, 29, 33, 0, 19, 33, 19, 28, 33, 28, 8, 33, 8, 13, 33, 13, 12, 33, 12, 14, 33, 14, 1, 33, 1, 0, 0, 63, 0, 1, 0, 15, 1, 16, 1, 26, 2, 8, 2, 21, 2, 31, 3, 5, 3, 54, 3, 12, 4, 27, 4, 32, 4, 5, 5, 20, 6, 34, 6, 17, 6, 25, 7, 60, 7, 18, 7, 8, 8, 9, 9, 30, 9, 61, 10, 12, 10, 53, 10, 42, 11, 41, 11, 28, 11, 12, 13, 17, 13, 50, 13, 14, 14, 56, 14, 15, 15, 16, 16, 17, 18, 21, 18, 19, 19, 59, 19, 20, 20, 21, 22, 23, 22, 43, 22, 52, 23, 37, 23, 33, 24, 28, 24, 45, 24, 25, 25, 26, 26, 27, 27, 28, 29, 32, 29, 62, 29, 30, 30, 31, 31, 32, 33, 35, 33, 47, 34, 46, 34, 35, 35, 44, 36, 40, 36, 48, 36, 37, 37, 38, 38, 51, 38, 39, 39, 55, 39, 40, 40, 58, 41, 45, 41, 42, 42, 43, 43, 44, 44, 45, 46, 50, 46, 47, 47, 48, 48, 49, 49, 57, 49, 50, 51, 55, 51, 52, 52, 53, 53, 54, 54, 55, 56, 63, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 0, 14, 15, 0, 1, 4, 0, 1, 15, 1, 6, 16, 2, 8, 9, 2, 7, 8, 2, 4, 5, 3, 4, 5, 3, 5, 19, 3, 10, 12, 6, 24, 25, 6, 13, 17, 7, 8, 9, 7, 18, 19, 9, 29, 30, 10, 11, 12, 10, 22, 42, 11, 24, 28, 13, 14, 15, 13, 14, 49, 18, 19, 20, 22, 23, 37, 22, 23, 33, 23, 33, 36, 24, 25, 26, 29, 30, 31, 33, 34, 35, 36, 37, 38, 36, 40, 48, 38, 39, 51, 41, 42, 43, 46, 47, 48, 51, 52, 53, 56, 57, 58, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 3, 0, 2, 0, 1, 0, 3, 0, 4, 0, 5, 0, 5, 0, 6, 0, 6, 0, 4, 0, 7, 0, 8, 0, 8, 0, 9, 0, 9, 0, 7, 0, 7, 0, 1, 0, 1, 0, 6, 0, 6, 0, 7, 0, 6, 0, 8, 0, 10, 0, 11, 0, 11, 0, 3, 0, 3, 0, 10, 0, 12, 0, 13, 0, 13, 0, 5, 0, 5, 0, 12, 0, 4, 0, 12, 0, 4, 0, 14, 0, 14, 0, 12, 0, 15, 0, 9, 0, 9, 0, 16, 0, 16, 0, 15, 0, 15, 0, 17, 0, 17, 0, 7, 0, 7, 0, 15, 0, 18, 0, 11, 0, 11, 0, 19, 0, 19, 0, 18, 0, 19, 0, 0, 0, 0, 0, 18, 0, 2, 0, 18, 0, 3, 0, 18, 0, 20, 0, 5, 0, 13, 0, 20, 0, 13, 0, 8, 0, 8, 0, 20, 0, 6, 0, 20, 0, 21, 0, 22, 0, 22, 0, 16, 0, 16, 0, 21, 0, 21, 0, 23, 0, 23, 0, 22, 0, 24, 0, 17, 0, 17, 0, 10, 0, 10, 0, 24, 0, 3, 0, 24, 0, 1, 0, 24, 0, 7, 0, 24, 0, 25, 0, 1, 0, 1, 0, 14, 0, 14, 0, 25, 0, 4, 0, 25, 0, 6, 0, 25, 0, 26, 0, 22, 0, 23, 0, 26, 0, 26, 0, 11, 0, 10, 0, 26, 0, 10, 0, 22, 0, 27, 0, 28, 0, 28, 0, 23, 0, 23, 0, 27, 0, 21, 0, 27, 0, 21, 0, 29, 0, 29, 0, 27, 0, 29, 0, 8, 0, 8, 0, 27, 0, 8, 0, 28, 0, 30, 0, 17, 0, 15, 0, 30, 0, 16, 0, 30, 0, 22, 0, 30, 0, 10, 0, 30, 0, 31, 0, 11, 0, 26, 0, 31, 0, 23, 0, 31, 0, 28, 0, 31, 0, 28, 0, 19, 0, 19, 0, 31, 0, 32, 0, 29, 0, 21, 0, 32, 0, 16, 0, 32, 0, 9, 0, 32, 0, 8, 0, 32, 0, 33, 0, 0, 0, 19, 0, 33, 0, 28, 0, 33, 0, 8, 0, 33, 0, 13, 0, 33, 0, 12, 0, 33, 0, 14, 0, 33, 0, 1, 0, 33, 0, 0, 0, 0, 0, 192, 162, 112, 189, 156, 71, 100, 189, 22, 210, 222, 189, 250, 84, 26, 63, 168, 2, 114, 61, 208, 138, 246, 59, 223, 22, 192, 59, 76, 239, 234, 55, 238, 242, 127, 181, 218, 223, 191, 56, 238, 242, 127, 181, 59, 119, 56, 58, 50, 191, 112, 52, 218, 223, 191, 56, 50, 191, 112, 52, 52, 86, 51, 58, 202, 215, 148, 62, 234, 85, 16, 58, 238, 119, 103, 189, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 5, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 5, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 14, 12, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 22, 21, 21, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 22, 22, 22, 22, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 30, 30, 22, 22, 22, 22, 15, 15, 15, 15, 15, 15, 15, 15, 15, 30, 30, 30, 22, 22, 22, 22, 15, 15, 15, 15, 15, 15, 15, 15, 15, 30, 30, 30, 22, 22, 22, 22, 17, 17, 17, 17, 17, 17, 17, 17, 17, 30, 30, 30, 22, 22, 22, 22, 17, 17, 17, 17, 17, 17, 17, 17, 17, 30, 30, 30, 22, 22, 26, 26, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 10, 10, 10, 26, 26, 26, 17, 17, 17, 17, 17, 17, 17, 17, 17, 10, 10, 10, 10, 26, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 10, 10, 10, 10, 10, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 10, 10, 10, 10, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 10, 10, 10, 10, 10, 26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 10, 10, 10, 10, 11, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 10, 10, 10, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 10, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, 11, 11, 11, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 25, 25, 25, 25, 3, 3, 3, 3, 3, 2, 2, 2, 0, 33, 33, 33, 14, 14, 14, 14, 3, 3, 3, 3, 3, 2, 2, 18, 0, 33, 33, 33, 33, 33, 12, 12, 3, 3, 3, 3, 3, 18, 18, 18, 0, 33, 33, 33, 33, 33, 12, 12, 3, 11, 11, 11, 11, 18, 18, 18, 0, 33, 33, 33, 33, 33, 12, 12, 11, 11, 11, 11, 11, 11, 18, 19, 0, 33, 33, 33, 33, 33, 12, 12, 11, 11, 11, 11, 11, 11, 19, 19, 0, 33, 33, 33, 33, 33, 12, 12, 11, 11, 11, 11, 11, 11, 19, 19, 0, 33, 33, 33, 33, 33, 33, 12, 11, 11, 11, 11, 11, 31, 19, 0, 33, 33, 33, 33, 33, 33, 33, 12, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 15, 9, 9, 9, 9, 9, 7, 7, 7, 6, 6, 6, 6, 6, 15, 15, 16, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 20, 20, 20, 16, 16, 16, 16, 32, 32, 32, 32, 8, 8, 8, 8, 8, 20, 20, 20, 16, 16, 16, 32, 32, 32, 32, 32, 8, 8, 8, 8, 8, 20, 20, 20, 16, 16, 16, 32, 32, 32, 32, 29, 8, 8, 8, 8, 8, 20, 20, 20, 16, 16, 21, 21, 21, 21, 29, 29, 8, 8, 8, 8, 8, 20, 20, 20, 22, 21, 21, 21, 21, 21, 29, 29, 8, 8, 8, 8, 8, 8, 20, 20, 21, 21, 21, 21, 21, 21, 29, 29, 8, 8, 8, 8, 8, 8, 20, 20, 21, 21, 21, 21, 21, 21, 29, 8, 8, 8, 8, 8, 8, 8, 20, 20, 21, 22, 22, 22, 22, 22, 26, 26, 26, 26, 26, 26, 11, 11, 11, 11, 21, 21, 22, 22, 22, 26, 26, 26, 26, 26, 26, 26, 11, 11, 11, 11, 21, 21, 21, 21, 22, 26, 26, 26, 26, 26, 26, 31, 11, 11, 11, 11, 21, 21, 21, 21, 21, 23, 23, 26, 26, 31, 31, 31, 31, 11, 11, 11, 21, 21, 21, 21, 23, 23, 23, 23, 23, 31, 31, 31, 31, 31, 31, 11, 21, 21, 21, 21, 23, 23, 23, 23, 23, 23, 31, 31, 31, 31, 31, 31, 29, 29, 27, 27, 27, 27, 23, 23, 28, 28, 31, 31, 19, 19, 19, 19, 8, 8, 8, 27, 27, 27, 28, 28, 28, 28, 28, 19, 19, 19, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 33, 33, 33, 33, 33, 33, 33, 33, 8, 8, 8, 8, 8, 8, 8, 13, 13, 33, 33, 33, 33, 33, 33, 33, 8, 8, 8, 8, 8, 8, 20, 13, 13, 13, 33, 33, 33, 33, 33, 33, 8, 8, 8, 8, 20, 20, 13, 13, 13, 13, 12, 33, 33, 33, 33, 33, 8, 8, 8, 20, 20, 20, 13, 13, 13, 13, 12, 12, 12, 33, 33, 33, 8, 20, 20, 20, 20, 13, 13, 13, 13, 13, 13, 12, 12, 12, 33, 33, 20, 20, 20, 20, 20, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 33, 20, 20, 20, 20, 20, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 17, 17, 17, 17, 24, 24, 24, 24, 3, 3, 3, 15, 15, 15, 15, 15, 17, 17, 17, 17, 24, 24, 24, 3, 3, 3, 3, 15, 15, 15, 15, 15, 15, 17, 17, 17, 24, 24, 24, 3, 3, 3, 3, 9, 15, 15, 15, 15, 15, 17, 17, 24, 24, 24, 3, 3, 3, 3, 3, 9, 9, 9, 15, 15, 15, 15, 17, 24, 24, 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 15, 15, 15, 17, 24, 24, 3, 3, 3, 3, 3, 2, 9, 9, 9, 9, 9, 9, 15, 17, 24, 3, 3, 3, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 15, 3, 2, 2, 2, 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 6, 25, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 6, 6, 6, 4, 25, 25, 1, 1, 1, 1, 1, 7, 7, 6, 6, 6, 6, 6, 4, 4, 25, 25, 25, 25, 1, 1, 1, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 25, 25, 25, 25, 25, 1, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 25, 25, 25, 25, 25, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 4, 25, 25, 25, 25, 25, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 25, 25, 25, 25, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 25, 25, 25, 25, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, 11, 11, 11, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, 11, 11, 10, 10, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, 11, 10, 10, 10, 10, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 26, 10, 10, 10, 10, 10, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 10, 10, 10, 10, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 10, 10, 10, 10, 10, 24, 24, 24, 24, 24, 24, 24, 24, 24, 26, 26, 26, 10, 10, 10, 10, 17, 17, 17, 17, 17, 17, 17, 17, 17, 26, 26, 26, 10, 10, 10, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 26, 26, 22, 22, 30, 30, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 22, 22, 22, 22, 30, 30, 30, 17, 17, 17, 17, 17, 17, 17, 17, 17, 22, 22, 22, 22, 30, 30, 30, 15, 15, 15, 15, 15, 15, 15, 15, 15, 22, 22, 22, 22, 30, 30, 30, 15, 15, 15, 15, 15, 15, 15, 15, 15, 22, 22, 22, 22, 30, 30, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 22, 22, 22, 22, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 21, 21, 22, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 12, 12, 12, 12, 12, 12, 14, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 5, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 5, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6, 6, 6, 6, 6, 6, 6, 20, 20, 8, 8, 8, 8, 8, 8, 8, 29, 21, 21, 21, 21, 21, 21, 20, 20, 8, 8, 8, 8, 8, 8, 29, 29, 21, 21, 21, 21, 21, 21, 20, 20, 8, 8, 8, 8, 8, 8, 29, 29, 21, 21, 21, 21, 21, 22, 20, 20, 20, 8, 8, 8, 8, 8, 29, 29, 21, 21, 21, 21, 16, 16, 20, 20, 20, 8, 8, 8, 8, 8, 29, 32, 32, 32, 32, 16, 16, 16, 20, 20, 20, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, 16, 16, 16, 20, 20, 20, 8, 8, 8, 8, 8, 32, 32, 32, 32, 16, 16, 16, 16, 20, 20, 20, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 16, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 6, 6, 6, 6, 6, 7, 7, 7, 9, 9, 9, 9, 9, 15, 15, 15, 12, 33, 33, 33, 33, 33, 33, 33, 0, 19, 31, 11, 11, 11, 11, 11, 12, 33, 33, 33, 33, 33, 33, 0, 19, 19, 11, 11, 11, 11, 11, 11, 12, 12, 33, 33, 33, 33, 33, 0, 19, 19, 11, 11, 11, 11, 11, 11, 12, 12, 33, 33, 33, 33, 33, 0, 19, 18, 11, 11, 11, 11, 11, 11, 12, 12, 33, 33, 33, 33, 33, 0, 18, 18, 18, 11, 11, 11, 11, 3, 12, 12, 33, 33, 33, 33, 33, 0, 18, 18, 18, 3, 3, 3, 3, 3, 12, 12, 33, 33, 33, 33, 33, 0, 18, 2, 2, 3, 3, 3, 3, 3, 14, 14, 14, 14, 33, 33, 33, 0, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 25, 25, 25, 25, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 25, 25, 25, 25, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 25, 25, 25, 25, 25, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 25, 25, 25, 25, 25, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 1, 25, 25, 25, 25, 25, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 25, 25, 25, 25, 4, 4, 6, 6, 6, 6, 6, 7, 7, 1, 1, 1, 1, 1, 25, 25, 4, 6, 6, 6, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 25, 6, 7, 7, 7, 7, 7, 7, 7, 2, 2, 2, 2, 2, 2, 2, 3, 15, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 3, 3, 3, 24, 17, 15, 9, 9, 9, 9, 9, 9, 2, 3, 3, 3, 3, 3, 24, 24, 17, 15, 15, 15, 9, 9, 9, 9, 3, 3, 3, 3, 3, 3, 24, 24, 17, 15, 15, 15, 15, 9, 9, 9, 3, 3, 3, 3, 3, 24, 24, 24, 17, 17, 15, 15, 15, 15, 15, 9, 3, 3, 3, 3, 24, 24, 24, 17, 17, 17, 15, 15, 15, 15, 15, 15, 3, 3, 3, 3, 24, 24, 24, 17, 17, 17, 17, 15, 15, 15, 15, 15, 3, 3, 3, 24, 24, 24, 24, 17, 17, 17, 17, 15, 15, 15, 15, 15, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 20, 20, 20, 20, 20, 33, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 20, 20, 20, 20, 20, 33, 33, 12, 12, 12, 13, 13, 13, 13, 13, 13, 20, 20, 20, 20, 8, 33, 33, 33, 12, 12, 12, 13, 13, 13, 13, 20, 20, 20, 8, 8, 8, 33, 33, 33, 33, 33, 12, 13, 13, 13, 13, 20, 20, 8, 8, 8, 8, 33, 33, 33, 33, 33, 33, 13, 13, 13, 20, 8, 8, 8, 8, 8, 8, 33, 33, 33, 33, 33, 33, 33, 13, 13, 8, 8, 8, 8, 8, 8, 8, 33, 33, 33, 33, 33, 33, 33, 33, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 19, 19, 19, 28, 28, 28, 28, 28, 27, 27, 27, 8, 8, 8, 19, 19, 19, 19, 31, 31, 28, 28, 23, 23, 27, 27, 27, 27, 29, 29, 31, 31, 31, 31, 31, 31, 23, 23, 23, 23, 23, 23, 21, 21, 21, 21, 11, 31, 31, 31, 31, 31, 31, 23, 23, 23, 23, 23, 21, 21, 21, 21, 11, 11, 11, 31, 31, 31, 31, 26, 26, 23, 23, 21, 21, 21, 21, 21, 11, 11, 11, 11, 31, 26, 26, 26, 26, 26, 26, 22, 21, 21, 21, 21, 11, 11, 11, 11, 26, 26, 26, 26, 26, 26, 26, 22, 22, 22, 21, 21, 11, 11, 11, 11, 26, 26, 26, 26, 26, 26, 22, 22, 22, 22, 22, 21, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 34, 0, 0, 0, 192, 0, 0, 0, 10, 0, 0, 0, 5, 9, 4, 6, 5, 5, 7, 7, 10, 5, 7, 6, 5, 5, 5, 5, 6, 5, 5, 6, 4, 6, 6, 6, 5, 4, 5, 5, 6, 4, 5, 5, 5, 8, 1, 33, 19, 18, 2, 2, 3, 24, 7, 6, 25, 14, 33, 0, 0, 18, 3, 1, 2, 18, 11, 10, 24, 1, 5, 12, 14, 25, 6, 6, 20, 13, 12, 4, 4, 25, 1, 7, 8, 20, 5, 8, 6, 1, 24, 17, 15, 9, 9, 32, 29, 27, 28, 33, 13, 20, 6, 7, 7, 15, 16, 32, 8, 11, 26, 22, 30, 17, 24, 3, 3, 18, 19, 31, 26, 10, 13, 33, 14, 4, 5, 5, 20, 8, 33, 12, 12, 33, 1, 25, 4, 9, 7, 17, 30, 16, 15, 30, 22, 21, 32, 9, 7, 24, 10, 30, 15, 11, 3, 2, 0, 19, 18, 0, 33, 28, 31, 11, 5, 6, 8, 13, 22, 23, 27, 29, 32, 16, 16, 30, 10, 26, 23, 21, 22, 26, 31, 28, 27, 21, 17, 7, 1, 3, 10, 1, 6, 4, 14, 22, 10, 11, 31, 23, 28, 8, 29, 21, 23, 23, 31, 19, 33, 8, 27, 27, 8, 32, 21, 17, 10, 22, 16, 15, 11, 19, 28, 23, 26, 29, 8, 9, 16, 21, 0, 1, 14, 12, 13, 8, 28, 19, 0, 0, 128, 191, 215, 229, 71, 61, 48, 168, 144, 62, 119, 210, 230, 60, 119, 210, 230, 60] + } + } + } + + over "link_4" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "wrist_2_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "collisions" + { + over "collisions_4" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 228, 124, 194, 10, 179, 176, 109, 19, 157, 53, 78, 139, 32, 183, 221, 124, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 48, 0, 0, 0, 80, 128, 0, 0, 34, 0, 0, 0, 160, 0, 0, 0, 89, 110, 28, 188, 209, 34, 91, 189, 166, 155, 68, 61, 89, 110, 28, 188, 166, 155, 68, 189, 61, 10, 87, 61, 45, 189, 222, 188, 28, 173, 38, 189, 61, 10, 87, 61, 89, 110, 28, 60, 209, 34, 91, 189, 166, 155, 68, 189, 89, 110, 28, 188, 209, 34, 91, 189, 166, 155, 68, 189, 89, 110, 28, 188, 70, 182, 115, 61, 166, 155, 68, 189, 89, 110, 28, 60, 70, 182, 115, 61, 166, 155, 68, 189, 28, 173, 38, 61, 209, 34, 91, 189, 45, 189, 222, 188, 28, 173, 38, 61, 70, 182, 115, 61, 45, 189, 222, 188, 166, 155, 68, 61, 70, 182, 115, 61, 89, 110, 28, 188, 166, 155, 68, 61, 209, 34, 91, 189, 89, 110, 28, 188, 45, 189, 222, 60, 70, 182, 115, 61, 28, 173, 38, 189, 45, 189, 222, 60, 209, 34, 91, 189, 28, 173, 38, 189, 45, 189, 222, 188, 70, 182, 115, 61, 28, 173, 38, 189, 45, 189, 222, 188, 209, 34, 91, 189, 28, 173, 38, 189, 28, 173, 38, 189, 209, 34, 91, 189, 45, 189, 222, 188, 28, 173, 38, 189, 70, 182, 115, 61, 45, 189, 222, 188, 166, 155, 68, 189, 209, 34, 91, 189, 89, 110, 28, 188, 166, 155, 68, 189, 70, 182, 115, 61, 89, 110, 28, 188, 166, 155, 68, 61, 70, 182, 115, 61, 89, 110, 28, 60, 28, 173, 38, 61, 70, 182, 115, 61, 45, 189, 222, 60, 166, 155, 68, 61, 89, 110, 28, 60, 61, 10, 87, 61, 166, 155, 68, 189, 209, 34, 91, 189, 89, 110, 28, 60, 28, 173, 38, 189, 209, 34, 91, 189, 45, 189, 222, 60, 28, 173, 38, 189, 45, 189, 222, 188, 61, 10, 87, 61, 166, 155, 68, 189, 89, 110, 28, 188, 61, 10, 87, 61, 166, 155, 68, 61, 209, 34, 91, 189, 89, 110, 28, 60, 166, 155, 68, 61, 89, 110, 28, 188, 61, 10, 87, 61, 28, 173, 38, 61, 45, 189, 222, 188, 61, 10, 87, 61, 28, 173, 38, 61, 209, 34, 91, 189, 45, 189, 222, 60, 166, 155, 68, 189, 89, 110, 28, 60, 61, 10, 87, 61, 28, 173, 38, 189, 45, 189, 222, 60, 61, 10, 87, 61, 28, 173, 38, 189, 70, 182, 115, 61, 45, 189, 222, 60, 166, 155, 68, 189, 70, 182, 115, 61, 89, 110, 28, 60, 89, 110, 28, 60, 70, 182, 115, 61, 166, 155, 68, 61, 45, 189, 222, 60, 28, 173, 38, 61, 61, 10, 87, 61, 45, 189, 222, 60, 70, 182, 115, 61, 28, 173, 38, 61, 45, 189, 222, 188, 70, 182, 115, 61, 28, 173, 38, 61, 89, 110, 28, 188, 70, 182, 115, 61, 166, 155, 68, 61, 45, 189, 222, 60, 28, 173, 38, 189, 61, 10, 87, 61, 45, 189, 222, 60, 209, 34, 91, 189, 28, 173, 38, 61, 28, 173, 38, 61, 45, 189, 222, 60, 61, 10, 87, 61, 89, 110, 28, 60, 209, 34, 91, 189, 166, 155, 68, 61, 45, 189, 222, 188, 209, 34, 91, 189, 28, 173, 38, 61, 89, 110, 28, 60, 166, 155, 68, 189, 61, 10, 87, 61, 45, 189, 222, 188, 28, 173, 38, 61, 61, 10, 87, 61, 89, 110, 28, 188, 166, 155, 68, 61, 61, 10, 87, 61, 89, 110, 28, 60, 166, 155, 68, 61, 61, 10, 87, 61, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 68, 182, 115, 189, 0, 0, 16, 0, 180, 230, 129, 190, 247, 205, 28, 191, 108, 166, 63, 63, 196, 170, 145, 189, 16, 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 166, 155, 68, 189, 19, 0, 4, 1, 94, 131, 108, 63, 0, 0, 0, 0, 24, 239, 195, 190, 167, 155, 68, 189, 23, 0, 4, 25, 243, 4, 53, 63, 0, 0, 0, 0, 243, 4, 53, 191, 165, 155, 68, 189, 27, 0, 4, 25, 24, 239, 195, 62, 0, 0, 0, 0, 94, 131, 108, 191, 167, 155, 68, 189, 31, 0, 4, 25, 24, 239, 195, 190, 0, 0, 0, 0, 94, 131, 108, 191, 166, 155, 68, 189, 35, 0, 4, 21, 243, 4, 53, 191, 0, 0, 0, 0, 243, 4, 53, 191, 165, 155, 68, 189, 39, 0, 4, 21, 94, 131, 108, 191, 0, 0, 0, 0, 24, 239, 195, 190, 166, 155, 68, 189, 43, 0, 4, 21, 165, 169, 96, 63, 15, 9, 160, 62, 221, 29, 186, 62, 135, 119, 131, 189, 47, 0, 3, 15, 111, 225, 92, 191, 81, 112, 179, 190, 65, 135, 186, 62, 137, 151, 130, 189, 50, 0, 4, 8, 47, 227, 92, 63, 48, 226, 180, 190, 71, 24, 185, 62, 78, 153, 130, 189, 54, 0, 4, 16, 255, 255, 127, 63, 0, 0, 0, 0, 0, 0, 0, 0, 166, 155, 68, 189, 58, 0, 6, 17, 174, 130, 84, 191, 172, 12, 176, 62, 67, 189, 224, 62, 215, 133, 135, 189, 64, 0, 3, 7, 164, 169, 96, 191, 18, 9, 160, 62, 224, 29, 186, 62, 135, 119, 131, 189, 67, 0, 3, 7, 255, 255, 127, 191, 0, 0, 0, 0, 0, 0, 0, 0, 166, 155, 68, 189, 70, 0, 6, 9, 206, 124, 169, 62, 114, 113, 0, 63, 231, 150, 76, 63, 154, 44, 146, 189, 76, 0, 3, 4, 136, 89, 30, 191, 38, 22, 248, 62, 136, 89, 30, 63, 165, 9, 145, 189, 79, 0, 3, 7, 16, 38, 17, 63, 16, 38, 17, 191, 61, 248, 24, 63, 72, 18, 143, 189, 82, 0, 4, 13, 175, 130, 84, 63, 172, 12, 176, 62, 65, 189, 224, 62, 215, 133, 135, 189, 86, 0, 3, 15, 136, 89, 30, 63, 36, 22, 248, 62, 136, 89, 30, 63, 165, 9, 145, 189, 89, 0, 3, 14, 132, 94, 240, 62, 132, 94, 240, 62, 86, 111, 63, 63, 124, 171, 145, 189, 92, 0, 3, 14, 78, 41, 149, 62, 198, 254, 37, 191, 186, 13, 52, 63, 26, 226, 145, 189, 95, 0, 3, 5, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 209, 34, 91, 189, 98, 0, 16, 5, 78, 41, 149, 190, 198, 254, 37, 191, 186, 13, 52, 63, 26, 226, 145, 189, 114, 0, 3, 6, 127, 200, 19, 191, 153, 235, 16, 191, 101, 165, 22, 63, 73, 231, 142, 189, 117, 0, 4, 11, 0, 0, 0, 0, 221, 27, 34, 191, 20, 34, 70, 63, 56, 119, 145, 189, 121, 0, 4, 5, 179, 230, 129, 62, 246, 205, 28, 191, 107, 166, 63, 63, 196, 170, 145, 189, 125, 0, 3, 5, 160, 212, 24, 190, 148, 123, 184, 62, 97, 186, 107, 63, 72, 88, 137, 189, 128, 0, 3, 3, 205, 124, 169, 190, 114, 113, 0, 63, 231, 150, 76, 63, 154, 44, 146, 189, 131, 0, 3, 3, 133, 94, 240, 190, 132, 94, 240, 62, 86, 111, 63, 63, 124, 171, 145, 189, 134, 0, 3, 12, 158, 212, 24, 62, 147, 123, 184, 62, 97, 186, 107, 63, 72, 88, 137, 189, 137, 0, 3, 4, 0, 0, 0, 0, 135, 146, 186, 62, 239, 101, 110, 63, 250, 242, 135, 189, 140, 0, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 63, 10, 87, 189, 144, 0, 16, 3, 37, 38, 34, 36, 20, 19, 9, 8, 11, 6, 5, 13, 16, 18, 33, 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 8, 7, 12, 11, 12, 3, 6, 13, 5, 4, 14, 15, 16, 13, 14, 15, 17, 18, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 26, 10, 9, 19, 21, 27, 30, 31, 32, 30, 32, 33, 30, 33, 18, 17, 22, 25, 34, 35, 36, 37, 32, 31, 28, 39, 40, 29, 41, 21, 20, 41, 20, 36, 41, 36, 35, 42, 40, 39, 43, 23, 22, 17, 15, 14, 4, 3, 12, 7, 10, 26, 29, 40, 42, 0, 43, 0, 2, 43, 2, 24, 23, 44, 1, 0, 42, 44, 42, 39, 45, 46, 38, 45, 38, 37, 45, 37, 31, 47, 35, 34, 47, 34, 38, 46, 47, 46, 45, 31, 30, 25, 24, 2, 1, 44, 39, 28, 27, 21, 41, 35, 0, 29, 0, 32, 0, 16, 0, 20, 0, 9, 0, 12, 0, 3, 0, 4, 0, 5, 0, 2, 0, 6, 0, 7, 0, 8, 0, 15, 0, 14, 0, 17, 1, 26, 1, 33, 1, 24, 2, 23, 2, 6, 2, 5, 3, 4, 3, 12, 3, 23, 4, 23, 4, 5, 5, 23, 6, 23, 6, 7, 7, 8, 7, 23, 8, 23, 8, 15, 9, 19, 9, 12, 10, 23, 10, 25, 10, 33, 10, 15, 11, 12, 11, 33, 11, 18, 11, 23, 12, 23, 12, 33, 13, 33, 13, 17, 13, 14, 14, 15, 15, 23, 15, 33, 16, 31, 16, 21, 17, 30, 18, 33, 18, 22, 18, 23, 19, 33, 19, 20, 20, 21, 21, 33, 22, 23, 22, 27, 23, 25, 23, 26, 23, 24, 24, 25, 25, 33, 26, 33, 26, 27, 27, 33, 28, 33, 28, 32, 28, 29, 29, 30, 30, 33, 31, 33, 31, 32, 32, 33, 1, 23, 24, 1, 26, 33, 1, 24, 25, 2, 5, 23, 2, 6, 23, 0, 2, 6, 0, 2, 5, 3, 4, 23, 0, 3, 4, 0, 3, 12, 3, 12, 23, 0, 4, 5, 4, 5, 23, 0, 6, 7, 6, 7, 23, 7, 8, 23, 0, 7, 8, 8, 15, 23, 0, 8, 15, 0, 9, 12, 0, 9, 19, 9, 12, 19, 10, 15, 23, 10, 23, 25, 10, 25, 33, 10, 15, 33, 11, 12, 23, 11, 12, 33, 11, 18, 33, 11, 18, 23, 13, 14, 15, 13, 17, 30, 0, 13, 14, 0, 14, 15, 0, 16, 31, 16, 21, 31, 0, 16, 20, 0, 17, 29, 0, 28, 29, 18, 22, 27, 18, 22, 23, 19, 20, 21, 22, 23, 26, 23, 24, 25, 26, 27, 33, 28, 29, 30, 28, 32, 33, 31, 32, 33, 37, 0, 38, 0, 38, 0, 34, 0, 34, 0, 36, 0, 36, 0, 20, 0, 20, 0, 19, 0, 19, 0, 9, 0, 9, 0, 8, 0, 8, 0, 11, 0, 11, 0, 6, 0, 6, 0, 5, 0, 5, 0, 13, 0, 13, 0, 16, 0, 16, 0, 18, 0, 18, 0, 33, 0, 33, 0, 32, 0, 32, 0, 37, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 3, 0, 4, 0, 4, 0, 5, 0, 6, 0, 3, 0, 7, 0, 8, 0, 9, 0, 10, 0, 10, 0, 7, 0, 7, 0, 12, 0, 12, 0, 11, 0, 12, 0, 3, 0, 4, 0, 14, 0, 14, 0, 13, 0, 15, 0, 16, 0, 14, 0, 15, 0, 15, 0, 17, 0, 17, 0, 18, 0, 20, 0, 21, 0, 21, 0, 19, 0, 22, 0, 23, 0, 23, 0, 24, 0, 24, 0, 25, 0, 25, 0, 22, 0, 26, 0, 27, 0, 27, 0, 28, 0, 28, 0, 29, 0, 29, 0, 26, 0, 26, 0, 10, 0, 21, 0, 27, 0, 30, 0, 31, 0, 31, 0, 32, 0, 32, 0, 30, 0, 33, 0, 30, 0, 17, 0, 22, 0, 25, 0, 30, 0, 34, 0, 35, 0, 35, 0, 36, 0, 31, 0, 37, 0, 28, 0, 39, 0, 39, 0, 40, 0, 40, 0, 29, 0, 41, 0, 21, 0, 20, 0, 41, 0, 36, 0, 41, 0, 35, 0, 41, 0, 42, 0, 40, 0, 39, 0, 42, 0, 43, 0, 23, 0, 42, 0, 0, 0, 0, 0, 43, 0, 2, 0, 43, 0, 2, 0, 24, 0, 44, 0, 1, 0, 42, 0, 44, 0, 39, 0, 44, 0, 45, 0, 46, 0, 46, 0, 38, 0, 38, 0, 45, 0, 37, 0, 45, 0, 31, 0, 45, 0, 47, 0, 35, 0, 34, 0, 47, 0, 46, 0, 47, 0, 0, 0, 0, 0, 166, 155, 68, 189, 210, 34, 91, 189, 166, 155, 68, 189, 166, 155, 68, 61, 70, 182, 115, 61, 62, 10, 87, 61, 254, 188, 120, 58, 212, 191, 224, 53, 56, 223, 153, 39, 117, 51, 11, 167, 56, 223, 153, 39, 248, 73, 177, 53, 169, 197, 15, 178, 117, 51, 11, 167, 169, 197, 15, 178, 46, 251, 214, 53, 109, 196, 84, 175, 241, 205, 58, 59, 250, 100, 170, 59, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 7, 7, 7, 7, 7, 10, 10, 10, 26, 26, 26, 29, 29, 29, 29, 29, 7, 7, 7, 7, 7, 10, 10, 10, 26, 26, 26, 29, 29, 29, 29, 28, 12, 7, 7, 7, 7, 10, 10, 10, 26, 26, 26, 29, 29, 29, 28, 28, 12, 7, 7, 7, 7, 10, 10, 10, 26, 26, 26, 29, 29, 28, 28, 28, 12, 7, 7, 7, 7, 10, 10, 10, 26, 26, 26, 29, 28, 28, 28, 28, 12, 7, 7, 7, 7, 10, 10, 10, 26, 26, 26, 27, 27, 27, 27, 27, 12, 7, 7, 7, 7, 10, 10, 10, 26, 26, 27, 27, 27, 27, 27, 27, 12, 7, 7, 7, 7, 10, 10, 10, 26, 27, 27, 27, 27, 27, 27, 27, 11, 8, 8, 8, 8, 9, 9, 9, 19, 21, 21, 21, 21, 21, 21, 21, 11, 8, 8, 8, 8, 9, 9, 9, 19, 19, 21, 21, 21, 21, 21, 21, 11, 8, 8, 8, 8, 9, 9, 9, 19, 19, 19, 21, 21, 21, 21, 21, 11, 8, 8, 8, 8, 9, 9, 9, 19, 19, 19, 20, 41, 41, 41, 41, 11, 8, 8, 8, 8, 9, 9, 9, 19, 19, 19, 20, 20, 20, 41, 41, 8, 8, 8, 8, 8, 9, 9, 9, 19, 19, 19, 20, 20, 20, 20, 41, 8, 8, 8, 8, 8, 9, 9, 9, 19, 19, 19, 20, 20, 20, 20, 20, 8, 8, 8, 8, 8, 9, 9, 9, 19, 19, 19, 20, 20, 20, 20, 20, 15, 15, 15, 15, 15, 17, 17, 17, 22, 22, 22, 23, 23, 23, 23, 23, 15, 15, 15, 15, 15, 17, 17, 17, 22, 22, 22, 23, 23, 23, 23, 24, 14, 15, 15, 15, 15, 17, 17, 17, 22, 22, 22, 23, 23, 23, 24, 24, 14, 15, 15, 15, 15, 17, 17, 17, 22, 22, 22, 23, 23, 24, 24, 24, 14, 15, 15, 15, 15, 17, 17, 17, 22, 22, 22, 23, 24, 24, 24, 24, 14, 15, 15, 15, 15, 17, 17, 17, 22, 22, 22, 25, 25, 25, 25, 25, 14, 15, 15, 15, 15, 17, 17, 17, 22, 22, 25, 25, 25, 25, 25, 25, 14, 15, 15, 15, 15, 17, 17, 17, 22, 25, 25, 25, 25, 25, 25, 25, 13, 16, 16, 16, 16, 18, 18, 18, 33, 30, 30, 30, 30, 30, 30, 30, 13, 16, 16, 16, 16, 18, 18, 18, 33, 33, 30, 30, 30, 30, 30, 30, 13, 16, 16, 16, 16, 18, 18, 18, 33, 33, 33, 30, 30, 30, 30, 30, 13, 16, 16, 16, 16, 18, 18, 18, 33, 33, 33, 32, 31, 31, 31, 31, 13, 16, 16, 16, 16, 18, 18, 18, 33, 33, 33, 32, 32, 32, 31, 31, 16, 16, 16, 16, 16, 18, 18, 18, 33, 33, 33, 32, 32, 32, 32, 31, 16, 16, 16, 16, 16, 18, 18, 18, 33, 33, 33, 32, 32, 32, 32, 32, 16, 16, 16, 16, 16, 18, 18, 18, 33, 33, 33, 32, 32, 32, 32, 32, 16, 13, 13, 13, 13, 5, 5, 5, 6, 6, 6, 11, 11, 11, 11, 11, 16, 13, 13, 13, 13, 5, 5, 5, 6, 6, 6, 11, 11, 11, 11, 8, 16, 16, 13, 13, 13, 13, 5, 5, 6, 6, 11, 11, 11, 11, 8, 8, 16, 16, 16, 13, 13, 13, 5, 5, 6, 6, 11, 11, 11, 8, 8, 8, 16, 16, 16, 16, 13, 13, 13, 5, 6, 11, 11, 8, 8, 8, 8, 8, 18, 18, 16, 16, 16, 13, 13, 5, 6, 11, 11, 8, 8, 8, 9, 9, 18, 18, 18, 18, 16, 16, 13, 5, 6, 8, 8, 8, 9, 9, 9, 9, 18, 18, 18, 18, 18, 18, 18, 13, 11, 9, 9, 9, 9, 9, 9, 9, 33, 33, 33, 33, 33, 33, 33, 32, 20, 19, 19, 19, 19, 19, 19, 19, 33, 33, 33, 33, 32, 32, 32, 38, 34, 20, 20, 20, 19, 19, 19, 19, 33, 33, 32, 32, 32, 32, 37, 38, 34, 36, 20, 20, 20, 20, 19, 19, 32, 32, 32, 32, 32, 37, 37, 38, 34, 36, 36, 20, 20, 20, 20, 20, 32, 32, 32, 32, 37, 37, 38, 38, 34, 34, 36, 36, 20, 20, 20, 20, 32, 32, 32, 37, 37, 37, 38, 38, 34, 34, 36, 36, 36, 20, 20, 20, 32, 32, 37, 37, 37, 38, 38, 38, 34, 34, 34, 36, 36, 36, 20, 20, 32, 37, 37, 37, 37, 38, 38, 38, 34, 34, 34, 36, 36, 36, 36, 20, 15, 14, 14, 14, 14, 4, 4, 4, 3, 3, 3, 12, 12, 12, 12, 12, 15, 14, 14, 14, 14, 4, 4, 4, 3, 3, 3, 12, 12, 12, 12, 7, 15, 15, 14, 14, 14, 14, 4, 4, 3, 3, 12, 12, 12, 12, 7, 7, 15, 15, 15, 14, 14, 14, 4, 4, 3, 3, 12, 12, 12, 7, 7, 7, 15, 15, 15, 15, 14, 14, 14, 4, 3, 12, 12, 12, 7, 7, 7, 7, 17, 17, 15, 15, 15, 14, 14, 4, 3, 12, 12, 7, 7, 7, 10, 10, 17, 17, 17, 17, 15, 15, 15, 4, 3, 12, 7, 7, 10, 10, 10, 10, 17, 17, 17, 17, 17, 17, 17, 14, 12, 10, 10, 10, 10, 10, 10, 10, 22, 22, 22, 22, 22, 22, 22, 23, 29, 26, 26, 26, 26, 26, 26, 26, 22, 22, 22, 22, 23, 23, 23, 0, 42, 29, 29, 29, 26, 26, 26, 26, 22, 22, 23, 23, 23, 23, 43, 0, 42, 40, 29, 29, 29, 29, 26, 26, 23, 23, 23, 23, 43, 43, 43, 0, 42, 40, 40, 29, 29, 29, 29, 29, 23, 23, 23, 23, 43, 43, 0, 0, 42, 42, 40, 40, 29, 29, 29, 29, 23, 23, 23, 43, 43, 43, 0, 0, 42, 42, 40, 40, 40, 29, 29, 29, 23, 23, 43, 43, 43, 0, 0, 0, 42, 42, 42, 40, 40, 40, 29, 29, 23, 43, 43, 43, 43, 0, 0, 0, 42, 42, 42, 40, 40, 40, 40, 29, 43, 24, 24, 24, 24, 25, 25, 25, 30, 30, 30, 31, 31, 31, 32, 32, 43, 24, 24, 24, 24, 25, 25, 25, 30, 30, 30, 31, 31, 37, 37, 37, 43, 2, 24, 24, 24, 24, 25, 25, 30, 30, 31, 31, 31, 37, 37, 37, 43, 2, 2, 24, 24, 24, 25, 25, 30, 30, 31, 31, 31, 37, 37, 37, 43, 2, 2, 2, 24, 24, 24, 25, 30, 31, 31, 31, 45, 37, 37, 37, 0, 0, 2, 2, 2, 24, 24, 25, 30, 31, 31, 45, 38, 38, 38, 38, 0, 0, 1, 1, 2, 2, 24, 25, 30, 31, 45, 38, 38, 38, 38, 38, 0, 0, 1, 1, 1, 1, 1, 24, 31, 46, 46, 38, 38, 38, 38, 38, 42, 42, 44, 44, 44, 44, 44, 39, 35, 47, 47, 34, 34, 34, 34, 34, 42, 42, 44, 44, 39, 39, 39, 27, 21, 35, 35, 34, 34, 34, 34, 34, 42, 42, 39, 39, 39, 39, 28, 27, 21, 41, 35, 35, 34, 34, 34, 34, 40, 39, 39, 39, 39, 28, 28, 27, 21, 41, 41, 35, 35, 36, 36, 36, 40, 39, 39, 39, 28, 28, 27, 27, 21, 21, 41, 41, 41, 36, 36, 36, 40, 39, 39, 28, 28, 28, 27, 27, 21, 21, 41, 41, 41, 36, 36, 36, 40, 39, 28, 28, 28, 27, 27, 27, 21, 21, 21, 41, 41, 36, 36, 36, 40, 28, 28, 28, 28, 27, 27, 27, 21, 21, 21, 41, 41, 41, 36, 36, 15, 15, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 8, 11, 11, 32, 32, 32, 32, 32, 33, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 32, 32, 32, 32, 32, 33, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 31, 32, 32, 32, 32, 33, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 31, 31, 32, 32, 32, 33, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 31, 31, 31, 31, 32, 33, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 30, 30, 30, 30, 30, 33, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 30, 30, 30, 30, 30, 30, 33, 33, 18, 18, 18, 16, 16, 16, 16, 16, 30, 30, 30, 30, 30, 30, 30, 33, 18, 18, 18, 16, 16, 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 22, 17, 17, 17, 15, 15, 15, 15, 15, 25, 25, 25, 25, 25, 25, 22, 22, 17, 17, 17, 15, 15, 15, 15, 15, 25, 25, 25, 25, 25, 22, 22, 22, 17, 17, 17, 15, 15, 15, 15, 15, 24, 24, 24, 24, 23, 22, 22, 22, 17, 17, 17, 15, 15, 15, 15, 15, 24, 24, 24, 23, 23, 22, 22, 22, 17, 17, 17, 15, 15, 15, 15, 15, 24, 24, 23, 23, 23, 22, 22, 22, 17, 17, 17, 15, 15, 15, 15, 14, 24, 23, 23, 23, 23, 22, 22, 22, 17, 17, 17, 15, 15, 15, 15, 15, 23, 23, 23, 23, 23, 22, 22, 22, 17, 17, 17, 15, 15, 15, 15, 15, 20, 20, 20, 20, 20, 19, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 20, 20, 20, 20, 20, 19, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 41, 20, 20, 20, 20, 19, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 41, 41, 20, 20, 20, 19, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 41, 41, 41, 41, 20, 19, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 21, 21, 21, 21, 21, 19, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 21, 21, 21, 21, 21, 21, 19, 19, 9, 9, 9, 8, 8, 8, 8, 8, 21, 21, 21, 21, 21, 21, 21, 19, 9, 9, 9, 8, 8, 8, 8, 8, 27, 27, 27, 27, 27, 27, 27, 26, 10, 10, 10, 7, 7, 7, 7, 7, 27, 27, 27, 27, 27, 27, 26, 26, 10, 10, 10, 7, 7, 7, 7, 7, 27, 27, 27, 27, 27, 26, 26, 26, 10, 10, 10, 7, 7, 7, 7, 7, 28, 28, 28, 28, 29, 26, 26, 26, 10, 10, 10, 7, 7, 7, 7, 7, 28, 28, 28, 29, 29, 26, 26, 26, 10, 10, 10, 7, 7, 7, 7, 7, 28, 28, 29, 29, 29, 26, 26, 26, 10, 10, 10, 7, 7, 7, 7, 12, 28, 29, 29, 29, 29, 26, 26, 26, 10, 10, 10, 7, 7, 7, 7, 7, 29, 29, 29, 29, 29, 26, 26, 26, 10, 10, 10, 7, 7, 7, 7, 7, 40, 40, 40, 40, 40, 42, 42, 42, 0, 0, 0, 43, 43, 43, 43, 43, 29, 40, 40, 40, 40, 42, 42, 42, 0, 0, 0, 43, 43, 43, 43, 23, 29, 29, 40, 40, 40, 40, 42, 42, 0, 0, 43, 43, 43, 43, 23, 23, 29, 29, 29, 40, 40, 40, 42, 42, 0, 0, 43, 43, 43, 23, 23, 23, 29, 29, 29, 29, 40, 40, 40, 42, 0, 43, 43, 43, 23, 23, 23, 23, 26, 26, 29, 29, 29, 40, 40, 42, 0, 43, 43, 23, 23, 23, 22, 22, 26, 26, 26, 26, 29, 29, 29, 42, 0, 43, 23, 23, 22, 22, 22, 22, 26, 26, 26, 26, 26, 26, 26, 40, 43, 22, 22, 22, 22, 22, 22, 22, 10, 10, 10, 10, 10, 10, 10, 7, 15, 17, 17, 17, 17, 17, 17, 17, 10, 10, 10, 10, 7, 7, 7, 3, 4, 15, 15, 15, 17, 17, 17, 17, 10, 10, 7, 7, 7, 7, 12, 3, 4, 14, 15, 15, 15, 15, 17, 17, 7, 7, 7, 7, 12, 12, 12, 3, 4, 14, 14, 15, 15, 15, 15, 15, 7, 7, 7, 7, 12, 12, 3, 3, 4, 4, 14, 14, 15, 15, 15, 15, 7, 7, 7, 12, 12, 12, 3, 3, 4, 4, 14, 14, 14, 15, 15, 15, 7, 7, 12, 12, 12, 3, 3, 3, 4, 4, 4, 14, 14, 14, 15, 15, 7, 12, 12, 12, 12, 3, 3, 3, 4, 4, 4, 14, 14, 14, 14, 15, 20, 36, 36, 36, 36, 34, 34, 34, 38, 38, 38, 37, 37, 37, 37, 37, 20, 36, 36, 36, 36, 34, 34, 34, 38, 38, 38, 37, 37, 37, 37, 32, 20, 20, 36, 36, 36, 36, 34, 34, 38, 38, 37, 37, 37, 37, 32, 32, 20, 20, 20, 36, 36, 36, 34, 34, 38, 38, 37, 37, 37, 32, 32, 32, 20, 20, 20, 20, 36, 36, 36, 34, 38, 37, 37, 32, 32, 32, 32, 32, 19, 19, 20, 20, 20, 36, 36, 34, 38, 37, 37, 32, 32, 32, 33, 33, 19, 19, 19, 19, 20, 20, 36, 34, 38, 32, 32, 32, 33, 33, 33, 33, 19, 19, 19, 19, 19, 19, 19, 36, 37, 33, 33, 33, 33, 33, 33, 33, 9, 9, 9, 9, 9, 9, 9, 8, 16, 18, 18, 18, 18, 18, 18, 18, 9, 9, 9, 9, 8, 8, 8, 6, 5, 16, 16, 16, 18, 18, 18, 18, 9, 9, 8, 8, 8, 8, 11, 6, 5, 13, 16, 16, 16, 16, 18, 18, 8, 8, 8, 8, 8, 11, 11, 6, 5, 13, 13, 16, 16, 16, 16, 16, 8, 8, 8, 8, 11, 11, 6, 6, 5, 5, 13, 13, 16, 16, 16, 16, 8, 8, 8, 11, 11, 11, 6, 6, 5, 5, 13, 13, 13, 16, 16, 16, 8, 8, 11, 11, 11, 6, 6, 6, 5, 5, 5, 13, 13, 13, 16, 16, 8, 11, 11, 11, 11, 6, 6, 6, 5, 5, 5, 13, 13, 13, 13, 16, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 16, 13, 13, 13, 16, 13, 15, 15, 14, 14, 14, 14, 14, 14, 20, 20, 41, 41, 41, 21, 21, 21, 27, 27, 27, 28, 28, 28, 28, 29, 36, 36, 36, 41, 41, 21, 21, 21, 27, 27, 27, 28, 28, 28, 28, 40, 36, 36, 36, 41, 41, 41, 21, 21, 27, 27, 28, 28, 28, 28, 39, 40, 36, 36, 36, 41, 41, 41, 21, 21, 27, 27, 28, 28, 28, 39, 39, 40, 36, 36, 36, 35, 41, 41, 41, 21, 27, 28, 28, 28, 39, 39, 39, 40, 34, 34, 34, 34, 35, 41, 41, 21, 27, 28, 28, 39, 39, 39, 42, 42, 34, 34, 34, 34, 34, 35, 41, 21, 27, 28, 39, 39, 44, 44, 42, 42, 34, 34, 34, 34, 34, 47, 47, 41, 28, 44, 44, 44, 44, 44, 42, 42, 38, 38, 38, 38, 38, 46, 46, 45, 2, 1, 1, 1, 1, 1, 0, 0, 38, 38, 38, 38, 38, 45, 45, 30, 25, 2, 2, 2, 1, 1, 0, 0, 38, 38, 38, 38, 45, 45, 31, 30, 25, 24, 2, 2, 2, 2, 0, 0, 37, 37, 37, 45, 45, 31, 31, 30, 25, 24, 24, 2, 2, 2, 2, 43, 37, 37, 37, 45, 31, 31, 30, 30, 25, 25, 24, 24, 2, 2, 2, 43, 37, 37, 37, 31, 31, 31, 30, 30, 25, 25, 24, 24, 24, 2, 2, 43, 37, 37, 37, 31, 31, 30, 30, 30, 25, 25, 25, 24, 24, 24, 2, 43, 37, 37, 31, 31, 31, 30, 30, 30, 25, 25, 25, 24, 24, 24, 24, 43, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 48, 0, 0, 0, 160, 0, 0, 0, 4, 0, 0, 0, 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 3, 3, 4, 3, 3, 1, 42, 43, 2, 2, 44, 0, 0, 43, 24, 1, 4, 12, 6, 5, 14, 3, 13, 4, 6, 5, 3, 11, 8, 12, 10, 11, 7, 9, 8, 10, 19, 7, 26, 9, 6, 12, 8, 11, 3, 7, 16, 14, 5, 13, 15, 4, 16, 17, 14, 18, 15, 13, 18, 22, 15, 33, 17, 16, 9, 21, 20, 19, 21, 41, 36, 19, 27, 41, 20, 23, 17, 25, 24, 43, 22, 25, 2, 23, 22, 30, 24, 27, 10, 29, 28, 21, 26, 29, 39, 27, 26, 40, 28, 31, 25, 33, 32, 32, 37, 45, 30, 37, 31, 30, 33, 32, 30, 18, 36, 35, 47, 38, 36, 41, 47, 34, 20, 41, 35, 34, 38, 45, 31, 32, 34, 46, 45, 37, 40, 42, 44, 28, 29, 42, 39, 21, 35, 36, 20, 40, 0, 44, 39, 23, 2, 0, 1, 39, 42, 46, 31, 37, 38, 38, 47, 45, 35, 46, 34, 0, 0, 128, 191, 160, 189, 65, 61, 120, 1, 0, 61, 176, 207, 102, 61, 120, 1, 0, 61] + } + } + } + + over "link_5" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "wrist_3_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0 + float physxJoint:maxJointVelocity = 180 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "collisions" + { + over "collisions_5" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 7, 150, 82, 191, 174, 64, 143, 24, 162, 162, 20, 175, 143, 82, 99, 37, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 36, 0, 0, 0, 97, 128, 0, 0, 63, 0, 0, 0, 194, 0, 0, 0, 49, 8, 172, 188, 32, 99, 110, 189, 219, 251, 20, 189, 234, 208, 105, 60, 178, 157, 111, 189, 78, 125, 32, 189, 198, 51, 40, 189, 178, 157, 111, 189, 62, 120, 237, 187, 133, 95, 42, 189, 77, 158, 50, 188, 58, 146, 75, 189, 85, 132, 155, 60, 66, 96, 101, 189, 53, 9, 30, 61, 89, 50, 71, 188, 66, 96, 101, 189, 132, 240, 40, 61, 85, 246, 29, 61, 32, 99, 110, 189, 32, 70, 136, 188, 100, 31, 36, 61, 66, 96, 101, 189, 235, 167, 127, 60, 122, 252, 222, 60, 243, 87, 8, 189, 58, 146, 75, 189, 200, 234, 22, 189, 66, 96, 101, 189, 170, 153, 181, 60, 187, 14, 213, 188, 86, 42, 104, 61, 39, 80, 4, 189, 234, 34, 5, 189, 237, 156, 230, 60, 58, 146, 75, 189, 126, 227, 43, 189, 19, 40, 98, 61, 83, 8, 228, 187, 8, 85, 42, 61, 76, 53, 51, 188, 58, 146, 75, 189, 91, 36, 45, 61, 1, 193, 92, 61, 174, 97, 6, 60, 89, 50, 71, 188, 132, 240, 40, 189, 58, 146, 75, 189, 39, 248, 166, 188, 242, 233, 113, 61, 4, 171, 234, 60, 8, 34, 11, 59, 215, 18, 114, 61, 156, 135, 19, 189, 204, 154, 24, 189, 35, 162, 88, 61, 109, 201, 170, 60, 32, 182, 116, 188, 79, 2, 91, 61, 136, 213, 31, 61, 118, 196, 161, 60, 137, 210, 94, 61, 222, 60, 21, 61, 169, 51, 119, 58, 35, 133, 178, 186, 44, 41, 55, 61, 213, 234, 171, 60, 95, 181, 178, 60, 189, 171, 30, 61, 70, 97, 23, 61, 81, 132, 84, 60, 130, 59, 208, 60, 8, 85, 42, 189, 76, 53, 51, 60, 58, 146, 75, 189, 211, 249, 240, 59, 249, 135, 45, 61, 58, 146, 75, 189, 6, 45, 36, 61, 80, 25, 127, 60, 58, 146, 75, 189, 154, 37, 1, 61, 242, 233, 113, 61, 41, 120, 138, 60, 145, 184, 7, 61, 73, 75, 101, 61, 140, 75, 213, 188, 160, 78, 57, 189, 140, 134, 12, 60, 212, 124, 21, 59, 147, 112, 33, 189, 127, 135, 34, 186, 174, 101, 178, 60, 244, 136, 209, 188, 74, 67, 141, 187, 173, 167, 22, 61, 237, 128, 43, 61, 109, 174, 90, 61, 46, 198, 64, 188, 187, 181, 12, 61, 35, 162, 88, 61, 187, 181, 204, 60, 142, 5, 133, 60, 110, 78, 101, 61, 45, 33, 31, 189, 89, 52, 29, 188, 81, 45, 98, 61, 222, 59, 42, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 57, 146, 75, 189, 0, 0, 8, 21, 204, 161, 33, 188, 60, 243, 127, 191, 25, 9, 140, 188, 113, 188, 113, 189, 8, 0, 3, 27, 210, 152, 58, 191, 227, 159, 235, 190, 192, 194, 1, 191, 132, 235, 119, 189, 11, 0, 3, 33, 160, 60, 137, 59, 182, 176, 127, 191, 222, 175, 72, 61, 210, 42, 109, 189, 14, 0, 3, 17, 229, 70, 144, 61, 196, 211, 126, 191, 156, 98, 132, 61, 205, 4, 116, 189, 17, 0, 3, 17, 124, 152, 16, 60, 4, 193, 127, 191, 236, 218, 47, 61, 121, 160, 108, 189, 20, 0, 3, 17, 247, 34, 155, 59, 15, 253, 127, 191, 114, 104, 6, 60, 190, 144, 110, 189, 23, 0, 3, 17, 219, 143, 18, 63, 230, 94, 12, 191, 220, 12, 28, 191, 80, 87, 131, 189, 26, 0, 3, 18, 117, 47, 150, 189, 250, 38, 126, 191, 192, 89, 194, 61, 130, 103, 119, 189, 29, 0, 3, 17, 184, 35, 68, 191, 174, 190, 231, 62, 51, 146, 233, 190, 83, 16, 119, 189, 32, 0, 3, 7, 134, 240, 127, 63, 243, 172, 158, 188, 242, 69, 33, 60, 234, 39, 41, 189, 35, 0, 3, 29, 236, 182, 126, 63, 101, 192, 187, 189, 59, 128, 36, 189, 131, 194, 53, 189, 38, 0, 3, 12, 150, 192, 48, 63, 201, 55, 227, 190, 192, 62, 18, 191, 206, 199, 125, 189, 41, 0, 3, 18, 57, 7, 174, 61, 106, 72, 215, 190, 191, 63, 103, 191, 56, 177, 122, 189, 44, 0, 3, 19, 43, 18, 141, 189, 206, 19, 24, 191, 66, 45, 77, 191, 14, 121, 133, 189, 47, 0, 3, 20, 193, 122, 217, 190, 99, 252, 210, 190, 53, 91, 78, 191, 70, 221, 126, 189, 50, 0, 3, 20, 167, 151, 183, 189, 83, 217, 126, 63, 250, 169, 250, 188, 71, 184, 116, 189, 53, 0, 3, 6, 213, 56, 8, 190, 118, 162, 125, 63, 24, 87, 216, 188, 151, 175, 119, 189, 56, 0, 3, 6, 3, 148, 203, 190, 243, 4, 104, 63, 178, 136, 18, 62, 112, 158, 134, 189, 59, 0, 3, 6, 213, 28, 1, 191, 232, 18, 31, 63, 83, 127, 25, 63, 200, 99, 131, 189, 62, 0, 3, 1, 194, 225, 57, 60, 154, 249, 97, 63, 248, 133, 240, 62, 102, 219, 133, 189, 65, 0, 3, 1, 64, 209, 173, 61, 204, 228, 170, 189, 37, 46, 126, 63, 245, 166, 54, 189, 68, 0, 3, 11, 7, 133, 151, 62, 153, 234, 27, 188, 96, 133, 116, 63, 227, 36, 48, 189, 71, 0, 3, 24, 91, 101, 79, 62, 29, 21, 157, 61, 157, 236, 121, 63, 17, 43, 51, 189, 74, 0, 3, 3, 239, 111, 144, 61, 110, 99, 252, 61, 254, 103, 125, 63, 213, 227, 52, 189, 77, 0, 3, 15, 155, 109, 34, 63, 138, 85, 146, 188, 142, 209, 69, 63, 138, 141, 47, 189, 80, 0, 3, 24, 195, 64, 60, 63, 172, 184, 128, 189, 144, 188, 44, 63, 142, 59, 50, 189, 83, 0, 3, 24, 167, 120, 116, 63, 114, 230, 94, 58, 239, 234, 151, 62, 45, 128, 47, 189, 86, 0, 3, 3, 207, 57, 75, 191, 32, 110, 214, 62, 178, 190, 225, 190, 238, 188, 115, 189, 89, 0, 3, 7, 133, 236, 247, 61, 180, 139, 125, 63, 90, 69, 136, 189, 54, 159, 122, 189, 92, 0, 3, 2, 163, 72, 27, 57, 252, 255, 127, 63, 95, 157, 43, 58, 109, 250, 113, 189, 95, 0, 3, 1, 36, 90, 118, 61, 10, 78, 118, 63, 96, 33, 136, 62, 192, 118, 129, 189, 98, 0, 3, 0, 236, 72, 124, 191, 176, 209, 168, 189, 16, 243, 23, 62, 190, 27, 53, 189, 101, 0, 3, 26, 246, 108, 118, 191, 50, 42, 47, 189, 170, 249, 136, 62, 177, 95, 51, 189, 104, 0, 3, 13, 30, 141, 115, 191, 253, 196, 50, 61, 169, 32, 156, 62, 170, 173, 52, 189, 107, 0, 3, 13, 217, 174, 122, 191, 225, 166, 211, 61, 234, 158, 50, 62, 4, 184, 58, 189, 110, 0, 3, 13, 71, 1, 127, 191, 164, 213, 103, 61, 201, 55, 138, 189, 222, 241, 57, 189, 113, 0, 3, 7, 152, 94, 127, 191, 100, 134, 239, 57, 65, 165, 143, 189, 35, 54, 56, 189, 116, 0, 3, 14, 170, 76, 127, 191, 38, 158, 97, 189, 253, 246, 73, 189, 125, 103, 54, 189, 119, 0, 3, 14, 26, 97, 33, 191, 35, 129, 176, 61, 205, 127, 69, 63, 246, 191, 52, 189, 122, 0, 3, 13, 95, 188, 58, 191, 4, 255, 40, 61, 41, 204, 46, 63, 116, 143, 50, 189, 125, 0, 3, 13, 150, 9, 61, 191, 51, 166, 241, 188, 198, 118, 44, 63, 225, 96, 51, 189, 128, 0, 3, 13, 236, 229, 27, 191, 241, 107, 184, 189, 73, 190, 73, 63, 193, 29, 56, 189, 131, 0, 3, 26, 208, 49, 147, 190, 133, 68, 4, 60, 23, 47, 117, 63, 76, 68, 46, 189, 134, 0, 3, 13, 183, 151, 147, 190, 125, 190, 130, 60, 74, 25, 117, 63, 170, 40, 46, 189, 137, 0, 3, 13, 217, 162, 80, 63, 187, 10, 200, 62, 74, 29, 219, 190, 132, 214, 117, 189, 140, 0, 3, 9, 178, 195, 185, 62, 186, 42, 110, 63, 101, 223, 89, 189, 71, 30, 134, 189, 143, 0, 3, 2, 114, 50, 211, 62, 93, 17, 105, 63, 171, 87, 0, 189, 89, 172, 135, 189, 146, 0, 3, 2, 198, 240, 127, 63, 64, 1, 245, 59, 198, 157, 165, 188, 187, 18, 46, 189, 149, 0, 3, 29, 25, 59, 126, 63, 44, 163, 102, 61, 22, 227, 210, 189, 49, 152, 59, 189, 152, 0, 3, 29, 26, 180, 30, 63, 21, 71, 161, 61, 93, 219, 71, 63, 194, 50, 56, 189, 155, 0, 3, 3, 152, 245, 39, 63, 140, 152, 80, 61, 20, 194, 64, 63, 150, 107, 52, 189, 158, 0, 3, 3, 142, 177, 102, 63, 57, 230, 129, 61, 24, 146, 219, 62, 129, 111, 56, 189, 161, 0, 3, 3, 160, 27, 29, 63, 107, 86, 55, 63, 116, 46, 170, 62, 144, 194, 137, 189, 164, 0, 3, 2, 54, 245, 220, 62, 234, 139, 72, 63, 200, 2, 229, 62, 95, 27, 138, 189, 167, 0, 3, 0, 61, 95, 6, 63, 217, 177, 253, 62, 4, 44, 49, 191, 180, 84, 129, 189, 170, 0, 3, 5, 58, 197, 180, 62, 229, 201, 220, 62, 18, 142, 84, 191, 128, 125, 126, 189, 173, 0, 3, 5, 245, 211, 43, 62, 124, 241, 117, 63, 177, 93, 98, 190, 110, 81, 133, 189, 176, 0, 3, 5, 218, 147, 50, 61, 190, 210, 69, 63, 101, 26, 34, 191, 238, 109, 140, 189, 179, 0, 3, 5, 130, 33, 136, 61, 158, 75, 24, 63, 52, 17, 77, 191, 43, 39, 134, 189, 182, 0, 3, 5, 222, 10, 15, 190, 137, 138, 200, 62, 187, 208, 104, 191, 99, 229, 120, 189, 185, 0, 3, 4, 165, 26, 192, 190, 242, 25, 11, 63, 129, 64, 64, 191, 36, 190, 132, 189, 188, 0, 3, 4, 215, 77, 3, 190, 215, 76, 107, 63, 254, 180, 190, 190, 254, 42, 138, 189, 191, 0, 3, 4, 24, 11, 25, 26, 13, 8, 15, 3, 0, 1, 2, 0, 2, 3, 4, 5, 2, 6, 7, 4, 6, 4, 2, 6, 2, 1, 6, 1, 8, 9, 2, 5, 10, 11, 12, 13, 14, 7, 13, 7, 6, 13, 6, 8, 15, 8, 1, 15, 1, 0, 15, 0, 3, 16, 17, 10, 16, 10, 12, 16, 12, 18, 16, 18, 19, 16, 19, 20, 21, 5, 4, 21, 4, 22, 21, 22, 20, 21, 20, 19, 23, 22, 4, 23, 4, 7, 23, 7, 14, 24, 12, 11, 27, 28, 17, 27, 17, 16, 27, 16, 20, 29, 2, 9, 29, 9, 30, 29, 30, 18, 29, 18, 12, 29, 12, 24, 29, 24, 3, 29, 3, 2, 31, 19, 18, 31, 18, 30, 31, 30, 9, 31, 9, 5, 31, 5, 21, 31, 21, 19, 32, 26, 28, 32, 28, 27, 32, 27, 14, 32, 14, 13, 32, 13, 26, 33, 20, 22, 33, 22, 23, 33, 23, 14, 33, 14, 27, 33, 27, 20, 34, 28, 26, 34, 26, 25, 34, 17, 28, 35, 17, 34, 35, 34, 25, 35, 25, 11, 35, 11, 10, 35, 10, 17, 0, 28, 0, 60, 0, 56, 0, 49, 0, 12, 0, 13, 0, 15, 0, 37, 1, 14, 1, 6, 1, 2, 2, 38, 2, 15, 3, 21, 3, 8, 3, 5, 4, 11, 4, 26, 4, 5, 5, 6, 6, 7, 7, 13, 7, 12, 8, 32, 8, 42, 9, 61, 9, 28, 9, 17, 10, 48, 10, 27, 10, 11, 11, 12, 13, 14, 14, 15, 16, 30, 16, 62, 16, 17, 17, 18, 18, 35, 18, 19, 19, 39, 19, 20, 20, 24, 20, 31, 21, 43, 21, 22, 22, 25, 22, 23, 23, 50, 23, 24, 24, 44, 25, 51, 25, 26, 26, 27, 27, 52, 28, 36, 29, 46, 29, 57, 29, 30, 30, 31, 31, 54, 32, 38, 32, 33, 33, 41, 33, 34, 34, 40, 34, 35, 35, 36, 36, 37, 37, 38, 39, 44, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 45, 49, 45, 55, 45, 46, 46, 47, 47, 53, 47, 48, 48, 49, 50, 54, 50, 51, 51, 52, 52, 53, 53, 54, 55, 57, 55, 56, 56, 59, 57, 58, 58, 62, 58, 59, 59, 60, 60, 61, 61, 62, 1, 2, 14, 1, 6, 7, 1, 2, 3, 0, 2, 15, 3, 4, 5, 3, 8, 21, 4, 5, 6, 4, 10, 11, 0, 7, 12, 8, 32, 33, 9, 16, 17, 0, 9, 28, 9, 17, 18, 0, 10, 11, 10, 27, 47, 0, 13, 14, 16, 17, 18, 16, 29, 30, 18, 19, 34, 19, 20, 24, 20, 23, 24, 21, 22, 23, 22, 23, 25, 25, 26, 27, 0, 28, 36, 0, 56, 59, 0, 45, 49, 29, 30, 31, 29, 45, 46, 32, 33, 34, 33, 34, 40, 39, 40, 41, 45, 46, 47, 50, 51, 52, 55, 56, 57, 58, 59, 60, 24, 0, 11, 0, 11, 0, 25, 0, 25, 0, 26, 0, 26, 0, 13, 0, 13, 0, 8, 0, 8, 0, 15, 0, 15, 0, 3, 0, 3, 0, 24, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 2, 0, 3, 0, 3, 0, 0, 0, 4, 0, 5, 0, 5, 0, 2, 0, 2, 0, 4, 0, 6, 0, 7, 0, 7, 0, 4, 0, 4, 0, 6, 0, 2, 0, 6, 0, 1, 0, 6, 0, 1, 0, 8, 0, 8, 0, 6, 0, 9, 0, 2, 0, 5, 0, 9, 0, 10, 0, 11, 0, 11, 0, 12, 0, 12, 0, 10, 0, 13, 0, 14, 0, 14, 0, 7, 0, 7, 0, 13, 0, 6, 0, 13, 0, 1, 0, 15, 0, 0, 0, 15, 0, 16, 0, 17, 0, 17, 0, 10, 0, 10, 0, 16, 0, 12, 0, 16, 0, 12, 0, 18, 0, 18, 0, 16, 0, 18, 0, 19, 0, 19, 0, 16, 0, 19, 0, 20, 0, 20, 0, 16, 0, 21, 0, 5, 0, 4, 0, 21, 0, 4, 0, 22, 0, 22, 0, 21, 0, 22, 0, 20, 0, 20, 0, 21, 0, 19, 0, 21, 0, 23, 0, 22, 0, 4, 0, 23, 0, 7, 0, 23, 0, 14, 0, 23, 0, 24, 0, 12, 0, 27, 0, 28, 0, 28, 0, 17, 0, 17, 0, 27, 0, 16, 0, 27, 0, 20, 0, 27, 0, 29, 0, 2, 0, 9, 0, 29, 0, 9, 0, 30, 0, 30, 0, 29, 0, 30, 0, 18, 0, 18, 0, 29, 0, 12, 0, 29, 0, 24, 0, 29, 0, 3, 0, 29, 0, 31, 0, 19, 0, 18, 0, 31, 0, 30, 0, 31, 0, 9, 0, 31, 0, 5, 0, 31, 0, 21, 0, 31, 0, 32, 0, 26, 0, 26, 0, 28, 0, 28, 0, 32, 0, 27, 0, 32, 0, 27, 0, 14, 0, 14, 0, 32, 0, 13, 0, 32, 0, 33, 0, 20, 0, 22, 0, 33, 0, 23, 0, 33, 0, 14, 0, 33, 0, 27, 0, 33, 0, 34, 0, 28, 0, 26, 0, 34, 0, 25, 0, 34, 0, 34, 0, 17, 0, 35, 0, 17, 0, 34, 0, 35, 0, 25, 0, 35, 0, 11, 0, 35, 0, 10, 0, 35, 0, 0, 0, 0, 0, 160, 78, 57, 189, 178, 157, 111, 189, 58, 146, 75, 189, 92, 36, 45, 61, 214, 18, 114, 61, 44, 41, 55, 61, 121, 225, 70, 58, 254, 247, 164, 53, 96, 130, 133, 177, 180, 44, 194, 176, 96, 130, 133, 177, 125, 140, 96, 53, 128, 251, 194, 48, 180, 44, 194, 176, 128, 251, 194, 48, 61, 154, 154, 53, 105, 44, 154, 185, 192, 76, 7, 57, 148, 231, 182, 187, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 4, 8, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 4, 8, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 4, 13, 13, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 4, 13, 13, 13, 13, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 4, 13, 13, 13, 13, 13, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 4, 13, 13, 13, 13, 13, 13, 13, 6, 7, 7, 7, 7, 7, 7, 7, 4, 13, 13, 13, 13, 13, 13, 13, 13, 7, 7, 7, 7, 7, 7, 23, 23, 26, 26, 26, 26, 26, 26, 26, 32, 14, 14, 14, 14, 23, 23, 23, 23, 26, 26, 26, 26, 26, 26, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 26, 26, 26, 26, 26, 32, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 26, 26, 26, 26, 32, 32, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 26, 26, 26, 28, 32, 32, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 26, 28, 28, 28, 32, 32, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 28, 28, 28, 28, 28, 32, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 28, 28, 28, 28, 28, 32, 32, 32, 14, 14, 14, 14, 33, 33, 33, 33, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 3, 3, 3, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 3, 3, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 3, 3, 3, 3, 29, 29, 9, 9, 9, 9, 9, 9, 24, 24, 24, 24, 24, 24, 24, 12, 29, 29, 18, 18, 18, 18, 18, 31, 24, 24, 24, 24, 24, 24, 12, 12, 12, 18, 18, 18, 18, 18, 18, 18, 24, 24, 24, 24, 24, 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 18, 24, 24, 24, 24, 12, 12, 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 11, 11, 11, 10, 12, 12, 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 11, 11, 10, 10, 12, 12, 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 18, 18, 18, 18, 18, 18, 10, 10, 10, 10, 35, 35, 35, 35, 35, 34, 34, 34, 34, 34, 28, 28, 10, 10, 10, 10, 10, 35, 35, 35, 34, 34, 34, 34, 34, 28, 28, 28, 10, 10, 10, 10, 10, 10, 35, 35, 17, 34, 34, 34, 28, 28, 28, 28, 10, 10, 10, 10, 10, 10, 35, 35, 17, 34, 34, 28, 28, 28, 28, 28, 12, 12, 10, 10, 10, 10, 10, 17, 17, 34, 34, 28, 28, 28, 28, 28, 12, 12, 12, 10, 10, 10, 10, 17, 17, 34, 28, 28, 28, 28, 32, 32, 12, 12, 12, 12, 12, 10, 10, 17, 17, 28, 28, 28, 28, 32, 32, 32, 12, 12, 12, 12, 12, 12, 12, 17, 17, 28, 28, 32, 32, 32, 32, 32, 12, 12, 12, 12, 12, 12, 16, 16, 27, 27, 27, 27, 14, 14, 14, 14, 12, 12, 12, 18, 18, 16, 16, 16, 27, 27, 27, 27, 27, 14, 14, 14, 18, 18, 18, 18, 16, 16, 16, 16, 20, 27, 27, 27, 27, 27, 14, 14, 18, 18, 18, 18, 16, 16, 16, 16, 20, 20, 20, 27, 27, 27, 14, 14, 18, 18, 18, 16, 16, 16, 16, 19, 20, 20, 20, 20, 33, 33, 33, 33, 18, 18, 18, 16, 16, 19, 19, 19, 20, 20, 20, 20, 20, 33, 33, 33, 18, 18, 16, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 33, 33, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 33, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 6, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 6, 6, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 6, 6, 6, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 6, 6, 6, 6, 2, 2, 2, 0, 0, 0, 0, 0, 1, 1, 1, 6, 6, 6, 6, 6, 2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, 2, 0, 0, 1, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, 2, 2, 0, 1, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, 4, 7, 7, 7, 7, 7, 7, 7, 2, 2, 9, 9, 9, 9, 9, 5, 4, 4, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 5, 5, 4, 4, 4, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 5, 5, 5, 4, 4, 4, 4, 7, 7, 7, 7, 9, 9, 9, 9, 9, 5, 5, 5, 4, 4, 4, 4, 4, 7, 7, 7, 9, 9, 9, 9, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 7, 7, 9, 9, 9, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 7, 9, 9, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 9, 9, 9, 9, 9, 9, 9, 9, 31, 18, 18, 18, 18, 18, 18, 18, 9, 9, 9, 9, 9, 9, 9, 31, 31, 18, 18, 18, 18, 18, 18, 18, 5, 5, 5, 5, 5, 5, 5, 31, 31, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 31, 31, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 21, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 21, 21, 19, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 21, 20, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 22, 20, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 22, 20, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 22, 20, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 22, 20, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 22, 33, 33, 33, 33, 33, 20, 20, 4, 4, 4, 4, 4, 4, 4, 23, 23, 33, 33, 33, 33, 33, 33, 33, 0, 0, 0, 3, 3, 3, 3, 3, 24, 24, 24, 24, 11, 11, 10, 10, 0, 0, 0, 3, 3, 3, 3, 3, 24, 24, 24, 11, 11, 11, 10, 10, 0, 0, 0, 3, 3, 3, 3, 3, 24, 24, 24, 11, 11, 11, 10, 10, 0, 0, 0, 0, 3, 3, 3, 3, 24, 24, 11, 11, 11, 11, 10, 10, 0, 0, 0, 0, 15, 3, 3, 3, 24, 24, 11, 11, 11, 35, 35, 35, 0, 0, 0, 15, 15, 15, 3, 3, 24, 11, 11, 11, 35, 35, 35, 35, 0, 0, 0, 15, 15, 15, 15, 3, 24, 11, 11, 11, 35, 35, 35, 35, 1, 1, 1, 15, 15, 15, 15, 15, 11, 25, 25, 25, 35, 35, 35, 35, 1, 1, 1, 1, 15, 15, 8, 8, 26, 25, 25, 25, 25, 35, 35, 35, 1, 1, 1, 1, 8, 8, 8, 13, 26, 26, 25, 25, 25, 34, 34, 34, 1, 1, 1, 1, 8, 8, 13, 13, 26, 26, 26, 25, 34, 34, 34, 34, 1, 1, 1, 8, 8, 8, 13, 13, 26, 26, 26, 26, 34, 34, 34, 34, 1, 1, 1, 8, 8, 13, 13, 13, 26, 26, 26, 26, 26, 34, 34, 34, 1, 1, 8, 8, 13, 13, 13, 13, 26, 26, 26, 26, 26, 34, 34, 34, 1, 1, 8, 8, 13, 13, 13, 13, 26, 26, 26, 26, 26, 26, 28, 28, 6, 8, 8, 13, 13, 13, 13, 13, 26, 26, 26, 26, 26, 26, 28, 28, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 10, 10, 10, 10, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 10, 10, 11, 11, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 10, 11, 11, 11, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 12, 12, 24, 24, 24, 24, 18, 18, 18, 18, 18, 18, 18, 12, 12, 12, 12, 24, 24, 24, 24, 24, 18, 18, 18, 18, 18, 18, 18, 12, 12, 12, 24, 24, 24, 24, 24, 24, 31, 18, 18, 18, 18, 18, 29, 29, 12, 24, 24, 24, 24, 24, 24, 24, 9, 9, 9, 9, 9, 9, 29, 29, 3, 3, 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 3, 3, 3, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 32, 28, 28, 28, 28, 28, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 32, 28, 28, 28, 28, 28, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 32, 32, 28, 28, 28, 26, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 32, 32, 28, 26, 26, 26, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 32, 32, 26, 26, 26, 26, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 32, 26, 26, 26, 26, 26, 33, 33, 33, 33, 14, 14, 14, 14, 32, 32, 26, 26, 26, 26, 26, 26, 23, 23, 23, 23, 14, 14, 14, 14, 32, 26, 26, 26, 26, 26, 26, 26, 23, 23, 7, 7, 7, 7, 7, 7, 13, 13, 13, 13, 13, 13, 13, 13, 4, 7, 7, 7, 7, 7, 7, 7, 6, 13, 13, 13, 13, 13, 13, 13, 4, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 13, 13, 13, 13, 13, 4, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 13, 13, 13, 13, 4, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 13, 13, 4, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 8, 4, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 8, 4, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 9, 9, 7, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 9, 9, 9, 7, 7, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 9, 9, 9, 9, 7, 7, 7, 4, 4, 4, 4, 4, 5, 5, 5, 9, 9, 9, 9, 9, 7, 7, 7, 7, 4, 4, 4, 4, 5, 5, 5, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 4, 4, 4, 5, 5, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 4, 4, 5, 9, 9, 9, 9, 9, 2, 2, 7, 7, 7, 7, 7, 7, 7, 4, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 1, 0, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 1, 0, 0, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 6, 6, 6, 6, 6, 1, 1, 1, 0, 0, 0, 0, 0, 2, 2, 2, 6, 6, 6, 6, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 2, 6, 6, 6, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 6, 6, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 6, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 33, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 18, 18, 33, 33, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 16, 18, 18, 33, 33, 33, 20, 20, 20, 20, 20, 19, 19, 19, 16, 16, 18, 18, 18, 33, 33, 33, 33, 20, 20, 20, 20, 19, 16, 16, 16, 16, 18, 18, 18, 14, 14, 27, 27, 27, 20, 20, 20, 16, 16, 16, 16, 18, 18, 18, 18, 14, 14, 27, 27, 27, 27, 27, 20, 16, 16, 16, 16, 18, 18, 18, 18, 14, 14, 14, 27, 27, 27, 27, 27, 16, 16, 16, 18, 18, 12, 12, 12, 14, 14, 14, 14, 27, 27, 27, 27, 16, 16, 12, 12, 12, 12, 12, 12, 32, 32, 32, 32, 32, 28, 28, 17, 17, 12, 12, 12, 12, 12, 12, 12, 32, 32, 32, 28, 28, 28, 28, 17, 17, 10, 10, 12, 12, 12, 12, 12, 32, 32, 28, 28, 28, 28, 34, 17, 17, 10, 10, 10, 10, 12, 12, 12, 28, 28, 28, 28, 28, 34, 34, 17, 17, 10, 10, 10, 10, 10, 12, 12, 28, 28, 28, 28, 28, 34, 34, 17, 35, 35, 10, 10, 10, 10, 10, 10, 28, 28, 28, 28, 34, 34, 34, 17, 35, 35, 10, 10, 10, 10, 10, 10, 28, 28, 28, 34, 34, 34, 34, 34, 35, 35, 35, 10, 10, 10, 10, 10, 28, 28, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 10, 10, 10, 10, 28, 28, 26, 26, 26, 26, 26, 26, 13, 13, 13, 13, 13, 8, 8, 6, 28, 28, 26, 26, 26, 26, 26, 26, 13, 13, 13, 13, 8, 8, 1, 1, 34, 34, 34, 26, 26, 26, 26, 26, 13, 13, 13, 13, 8, 8, 1, 1, 34, 34, 34, 26, 26, 26, 26, 26, 13, 13, 13, 8, 8, 1, 1, 1, 34, 34, 34, 34, 26, 26, 26, 26, 13, 13, 8, 8, 8, 1, 1, 1, 34, 34, 34, 34, 25, 26, 26, 26, 13, 13, 8, 8, 1, 1, 1, 1, 34, 34, 34, 25, 25, 25, 26, 26, 13, 8, 8, 8, 1, 1, 1, 1, 35, 35, 35, 25, 25, 25, 25, 26, 8, 8, 15, 15, 1, 1, 1, 1, 35, 35, 35, 35, 25, 25, 25, 11, 15, 15, 15, 15, 15, 1, 1, 1, 35, 35, 35, 35, 11, 11, 11, 24, 3, 15, 15, 15, 15, 0, 0, 0, 35, 35, 35, 35, 11, 11, 11, 24, 3, 3, 15, 15, 15, 0, 0, 0, 35, 35, 35, 11, 11, 11, 24, 24, 3, 3, 3, 15, 0, 0, 0, 0, 10, 10, 11, 11, 11, 11, 24, 24, 3, 3, 3, 3, 0, 0, 0, 0, 10, 10, 11, 11, 11, 24, 24, 24, 3, 3, 3, 3, 3, 0, 0, 0, 10, 10, 11, 11, 11, 24, 24, 24, 3, 3, 3, 3, 3, 0, 0, 0, 10, 10, 11, 11, 24, 24, 24, 24, 3, 3, 3, 3, 3, 0, 0, 0, 33, 33, 33, 33, 33, 33, 33, 23, 23, 4, 4, 4, 4, 4, 4, 4, 20, 20, 33, 33, 33, 33, 33, 22, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, 20, 22, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, 20, 22, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, 20, 22, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, 20, 22, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, 20, 21, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, 19, 21, 21, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 21, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 31, 31, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 31, 31, 5, 5, 5, 5, 5, 5, 5, 18, 18, 18, 18, 18, 18, 18, 31, 31, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, 18, 18, 18, 31, 9, 9, 9, 9, 9, 9, 9, 9, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 36, 0, 0, 0, 194, 0, 0, 0, 8, 0, 0, 0, 4, 5, 8, 5, 7, 5, 6, 5, 4, 5, 5, 5, 6, 6, 6, 4, 7, 6, 6, 5, 6, 6, 5, 5, 4, 4, 5, 7, 5, 7, 4, 6, 5, 5, 5, 5, 1, 15, 3, 2, 2, 6, 8, 15, 0, 0, 3, 29, 9, 5, 4, 6, 1, 24, 29, 2, 0, 15, 5, 21, 22, 23, 7, 6, 2, 2, 9, 31, 21, 4, 7, 13, 8, 1, 2, 4, 4, 23, 14, 13, 6, 15, 1, 6, 13, 2, 29, 30, 31, 5, 11, 35, 17, 16, 12, 25, 35, 10, 12, 24, 10, 16, 18, 29, 24, 11, 8, 6, 7, 14, 32, 26, 7, 23, 33, 27, 32, 13, 3, 0, 1, 8, 17, 27, 20, 19, 18, 12, 10, 10, 35, 34, 28, 27, 16, 16, 19, 31, 30, 29, 12, 16, 20, 21, 31, 18, 16, 27, 33, 22, 21, 19, 5, 31, 19, 20, 22, 4, 21, 20, 33, 23, 4, 22, 33, 14, 7, 4, 11, 12, 29, 3, 26, 34, 35, 11, 13, 32, 28, 34, 25, 28, 32, 14, 33, 20, 16, 17, 17, 34, 26, 32, 27, 2, 3, 24, 12, 18, 30, 9, 29, 18, 31, 9, 19, 21, 5, 9, 30, 18, 26, 13, 14, 27, 28, 20, 27, 14, 23, 22, 28, 17, 35, 25, 26, 17, 10, 11, 25, 34, 0, 0, 128, 191, 108, 152, 42, 61, 147, 252, 196, 60, 255, 23, 104, 61, 147, 252, 196, 60] + } + } + } + + over "link_6" ( + prepend apiSchemas = ["PhysxRigidBodyAPI"] + ) + { + bool physxRigidBody:disableGravity = 1 + + over "collisions" + { + over "collisions_6" ( + prepend apiSchemas = ["PhysxCookedDataAPI:convexHull"] + ) + { + token physics:approximation = "convexHull" + uchar[] physxCookedData:convexHull:buffer = [9, 143, 41, 154, 33, 41, 6, 252, 99, 144, 104, 55, 47, 155, 196, 44, 113, 78, 88, 83, 1, 67, 86, 88, 77, 14, 0, 0, 0, 0, 0, 0, 0, 73, 67, 69, 1, 67, 76, 72, 76, 9, 0, 0, 0, 34, 0, 0, 0, 96, 128, 0, 0, 64, 0, 0, 0, 192, 0, 0, 0, 240, 166, 219, 188, 28, 181, 194, 61, 149, 70, 76, 61, 177, 108, 230, 58, 126, 85, 206, 61, 146, 230, 79, 61, 0, 0, 0, 0, 68, 191, 214, 61, 214, 59, 92, 188, 6, 216, 7, 189, 73, 190, 178, 61, 140, 216, 39, 189, 231, 111, 2, 189, 16, 122, 150, 61, 224, 17, 85, 61, 100, 58, 244, 60, 115, 216, 253, 188, 140, 219, 104, 189, 172, 30, 48, 61, 9, 81, 190, 185, 140, 219, 104, 189, 242, 123, 27, 61, 55, 194, 162, 188, 41, 175, 21, 188, 37, 202, 222, 60, 74, 12, 194, 61, 124, 68, 76, 61, 47, 25, 7, 61, 16, 122, 150, 61, 106, 165, 80, 61, 18, 134, 1, 189, 209, 178, 238, 188, 140, 219, 104, 189, 85, 132, 27, 189, 169, 160, 162, 188, 91, 179, 21, 188, 172, 30, 48, 189, 176, 227, 191, 185, 140, 219, 104, 189, 102, 49, 177, 60, 121, 117, 174, 61, 162, 69, 118, 189, 143, 252, 1, 61, 207, 159, 182, 61, 106, 80, 52, 189, 149, 42, 209, 188, 68, 48, 174, 61, 237, 239, 108, 189, 109, 113, 141, 188, 213, 32, 204, 61, 15, 11, 53, 189, 93, 140, 1, 188, 74, 241, 177, 61, 110, 194, 125, 189, 142, 33, 128, 60, 207, 161, 204, 61, 182, 157, 54, 189, 210, 81, 142, 188, 84, 169, 25, 189, 214, 225, 232, 187, 2, 97, 167, 186, 216, 12, 48, 189, 140, 219, 104, 189, 172, 197, 39, 56, 10, 128, 49, 189, 66, 96, 101, 188, 36, 240, 135, 60, 97, 25, 27, 189, 214, 225, 232, 187, 115, 246, 78, 59, 162, 213, 73, 61, 85, 49, 85, 61, 187, 212, 136, 188, 152, 249, 78, 61, 64, 109, 84, 61, 218, 228, 48, 189, 90, 130, 140, 186, 188, 204, 48, 188, 81, 46, 141, 60, 180, 171, 80, 61, 64, 109, 84, 61, 136, 243, 48, 61, 115, 48, 27, 57, 188, 204, 48, 188, 80, 228, 201, 60, 244, 53, 203, 61, 65, 187, 195, 188, 77, 134, 227, 188, 18, 160, 198, 61, 193, 173, 187, 188, 218, 254, 21, 60, 255, 92, 148, 61, 5, 193, 131, 189, 57, 155, 14, 61, 104, 3, 176, 61, 229, 151, 193, 58, 172, 60, 1, 189, 199, 76, 130, 61, 255, 35, 83, 61, 253, 48, 2, 61, 36, 12, 131, 61, 255, 35, 83, 61, 108, 45, 73, 190, 54, 104, 122, 63, 11, 52, 139, 61, 48, 47, 208, 189, 0, 0, 3, 20, 150, 194, 120, 191, 149, 188, 108, 62, 181, 8, 69, 61, 29, 147, 78, 189, 3, 0, 3, 6, 6, 56, 88, 189, 237, 61, 227, 61, 98, 15, 126, 63, 226, 187, 123, 189, 6, 0, 3, 5, 127, 164, 106, 63, 89, 12, 202, 190, 183, 45, 132, 189, 194, 10, 49, 189, 9, 0, 3, 0, 228, 143, 108, 62, 42, 170, 120, 63, 216, 172, 100, 61, 149, 14, 207, 189, 12, 0, 3, 20, 242, 206, 75, 61, 205, 73, 130, 61, 230, 41, 127, 63, 37, 213, 105, 189, 15, 0, 3, 10, 137, 190, 109, 191, 50, 0, 188, 190, 120, 56, 85, 189, 134, 59, 48, 189, 18, 0, 3, 31, 140, 228, 79, 63, 232, 247, 57, 62, 246, 247, 13, 191, 176, 241, 135, 189, 21, 0, 3, 32, 238, 71, 99, 191, 200, 206, 52, 62, 140, 150, 217, 190, 112, 14, 127, 189, 24, 0, 3, 33, 80, 218, 29, 191, 52, 209, 49, 63, 95, 187, 189, 190, 187, 34, 197, 189, 27, 0, 3, 22, 6, 160, 103, 190, 178, 222, 58, 63, 22, 29, 37, 191, 100, 99, 215, 189, 30, 0, 3, 22, 42, 214, 107, 190, 62, 111, 18, 61, 46, 243, 120, 191, 5, 122, 133, 189, 33, 0, 3, 33, 189, 4, 254, 62, 251, 171, 55, 63, 180, 90, 250, 190, 71, 91, 207, 189, 36, 0, 3, 19, 217, 225, 171, 61, 47, 54, 61, 63, 49, 24, 43, 191, 79, 245, 214, 189, 39, 0, 3, 19, 61, 144, 83, 188, 117, 226, 78, 63, 136, 190, 22, 191, 127, 185, 218, 189, 42, 0, 3, 21, 75, 176, 23, 188, 109, 164, 124, 63, 170, 8, 37, 190, 5, 94, 216, 189, 45, 0, 3, 21, 109, 58, 39, 191, 204, 56, 65, 191, 4, 208, 117, 61, 115, 183, 32, 189, 48, 0, 3, 28, 40, 96, 212, 190, 192, 197, 104, 191, 219, 132, 12, 189, 29, 60, 42, 189, 51, 0, 3, 28, 46, 245, 161, 190, 176, 218, 114, 191, 200, 21, 247, 58, 186, 57, 40, 189, 54, 0, 3, 28, 72, 99, 190, 187, 78, 240, 15, 191, 82, 178, 83, 63, 130, 244, 122, 188, 57, 0, 3, 17, 29, 7, 3, 188, 63, 31, 70, 191, 2, 28, 34, 63, 184, 28, 202, 188, 60, 0, 3, 17, 226, 250, 163, 62, 26, 121, 114, 191, 124, 189, 144, 188, 208, 47, 41, 189, 63, 0, 3, 29, 60, 46, 184, 62, 194, 181, 110, 191, 215, 158, 8, 189, 146, 11, 42, 189, 66, 0, 3, 0, 10, 130, 37, 63, 243, 141, 66, 191, 172, 159, 136, 61, 130, 223, 31, 189, 69, 0, 3, 29, 214, 218, 47, 189, 168, 68, 14, 191, 68, 139, 84, 63, 18, 144, 128, 188, 72, 0, 3, 17, 146, 87, 40, 188, 63, 49, 95, 188, 116, 246, 127, 63, 124, 71, 82, 189, 75, 0, 3, 30, 1, 153, 118, 191, 125, 108, 137, 190, 229, 42, 4, 188, 159, 238, 43, 189, 78, 0, 3, 31, 230, 230, 125, 191, 124, 25, 253, 61, 249, 201, 4, 61, 250, 119, 45, 189, 81, 0, 3, 6, 24, 100, 126, 191, 110, 52, 229, 61, 51, 206, 26, 187, 40, 101, 47, 189, 84, 0, 3, 27, 101, 157, 156, 61, 63, 74, 13, 191, 65, 148, 84, 63, 176, 64, 133, 188, 87, 0, 3, 17, 182, 164, 119, 63, 99, 191, 129, 190, 26, 81, 190, 186, 237, 21, 43, 189, 90, 0, 3, 3, 61, 64, 12, 63, 192, 56, 79, 63, 214, 83, 88, 190, 240, 122, 202, 189, 93, 0, 3, 19, 29, 78, 77, 62, 25, 106, 122, 63, 201, 250, 94, 189, 112, 143, 211, 189, 96, 0, 3, 21, 157, 156, 120, 62, 111, 1, 120, 63, 165, 73, 78, 61, 142, 167, 206, 189, 99, 0, 3, 20, 196, 57, 144, 190, 142, 133, 117, 63, 87, 249, 236, 60, 54, 41, 205, 189, 102, 0, 3, 20, 236, 200, 137, 190, 255, 137, 118, 63, 11, 202, 56, 188, 9, 31, 207, 189, 105, 0, 3, 21, 101, 143, 32, 191, 26, 163, 63, 63, 234, 61, 92, 190, 61, 116, 194, 189, 108, 0, 3, 22, 20, 92, 100, 191, 84, 24, 231, 62, 31, 172, 193, 60, 12, 72, 139, 189, 111, 0, 3, 7, 81, 144, 151, 61, 185, 146, 124, 62, 185, 93, 119, 191, 212, 74, 165, 189, 114, 0, 3, 24, 8, 253, 146, 62, 146, 156, 15, 61, 43, 15, 117, 191, 45, 181, 136, 189, 117, 0, 3, 4, 219, 69, 233, 61, 106, 222, 72, 189, 28, 6, 126, 191, 141, 49, 123, 189, 120, 0, 3, 4, 111, 189, 211, 60, 225, 54, 137, 189, 205, 86, 127, 191, 156, 234, 115, 189, 123, 0, 3, 4, 5, 36, 232, 188, 140, 111, 126, 189, 17, 103, 127, 191, 249, 101, 115, 189, 126, 0, 3, 1, 239, 104, 188, 189, 31, 253, 20, 189, 134, 190, 126, 191, 238, 248, 119, 189, 129, 0, 3, 33, 146, 247, 14, 190, 211, 241, 230, 186, 4, 126, 125, 191, 27, 43, 127, 189, 132, 0, 3, 33, 32, 33, 78, 63, 29, 199, 23, 63, 130, 42, 76, 188, 241, 186, 161, 189, 135, 0, 3, 11, 160, 183, 72, 63, 12, 224, 30, 63, 230, 119, 44, 60, 21, 44, 165, 189, 138, 0, 3, 10, 145, 98, 117, 63, 224, 33, 136, 62, 93, 5, 210, 61, 98, 233, 102, 189, 141, 0, 3, 12, 51, 138, 126, 63, 129, 172, 181, 61, 35, 134, 114, 61, 243, 96, 45, 189, 144, 0, 3, 12, 71, 195, 126, 63, 89, 202, 200, 61, 110, 93, 179, 187, 194, 101, 48, 189, 147, 0, 3, 25, 125, 78, 125, 63, 47, 232, 7, 62, 144, 224, 107, 189, 168, 122, 59, 189, 150, 0, 3, 25, 86, 171, 250, 190, 26, 192, 249, 190, 210, 5, 57, 63, 118, 130, 177, 188, 153, 0, 3, 13, 188, 31, 231, 190, 157, 4, 253, 190, 200, 51, 62, 63, 42, 220, 172, 188, 156, 0, 3, 13, 221, 173, 132, 189, 4, 15, 75, 189, 147, 37, 127, 63, 233, 227, 77, 189, 159, 0, 3, 30, 41, 90, 121, 191, 137, 77, 34, 189, 46, 68, 100, 62, 25, 159, 34, 189, 162, 0, 3, 6, 70, 67, 101, 191, 22, 178, 91, 190, 51, 148, 199, 62, 174, 33, 14, 189, 165, 0, 3, 14, 125, 215, 56, 61, 148, 224, 110, 61, 147, 77, 127, 63, 234, 185, 103, 189, 168, 0, 3, 10, 172, 213, 69, 60, 247, 123, 0, 61, 248, 218, 127, 63, 150, 208, 92, 189, 171, 0, 3, 30, 117, 117, 30, 60, 95, 131, 121, 60, 85, 245, 127, 63, 90, 91, 88, 189, 174, 0, 3, 30, 255, 234, 68, 60, 116, 178, 46, 60, 138, 247, 127, 63, 5, 121, 87, 189, 177, 0, 3, 30, 120, 206, 234, 62, 16, 217, 252, 190, 208, 32, 61, 63, 235, 132, 172, 188, 180, 0, 3, 15, 45, 182, 246, 62, 113, 244, 250, 190, 96, 241, 57, 63, 238, 65, 175, 188, 183, 0, 3, 15, 153, 80, 103, 63, 248, 112, 82, 190, 119, 121, 192, 62, 228, 37, 15, 189, 186, 0, 3, 3, 79, 93, 116, 63, 123, 18, 210, 189, 75, 72, 143, 62, 40, 122, 28, 189, 189, 0, 3, 12, 0, 1, 2, 0, 3, 4, 0, 4, 1, 5, 6, 7, 8, 2, 1, 8, 1, 9, 10, 11, 12, 13, 14, 6, 15, 12, 3, 15, 3, 16, 15, 16, 17, 15, 17, 12, 18, 14, 13, 18, 13, 17, 18, 17, 16, 18, 16, 2, 19, 11, 10, 19, 10, 20, 19, 20, 21, 22, 23, 19, 22, 19, 21, 22, 21, 20, 22, 20, 5, 22, 5, 7, 24, 19, 23, 24, 23, 4, 25, 12, 11, 25, 4, 3, 25, 3, 12, 26, 23, 22, 27, 7, 6, 28, 14, 18, 28, 18, 2, 28, 2, 8, 29, 0, 2, 29, 2, 16, 29, 16, 3, 29, 3, 0, 30, 17, 13, 30, 13, 6, 30, 6, 5, 30, 5, 20, 30, 20, 10, 30, 10, 12, 30, 12, 17, 31, 14, 28, 31, 28, 8, 31, 8, 9, 31, 9, 27, 31, 27, 6, 31, 6, 14, 32, 11, 19, 32, 19, 24, 32, 24, 4, 32, 4, 25, 32, 25, 11, 33, 9, 1, 33, 1, 4, 33, 4, 23, 33, 23, 26, 33, 26, 22, 33, 22, 7, 33, 7, 27, 33, 27, 9, 0, 2, 0, 4, 0, 34, 1, 37, 1, 27, 1, 2, 2, 57, 3, 40, 3, 30, 3, 23, 4, 33, 4, 5, 5, 56, 5, 47, 6, 16, 6, 26, 6, 43, 7, 12, 7, 50, 7, 39, 8, 11, 8, 28, 8, 9, 9, 36, 9, 10, 10, 14, 10, 11, 11, 44, 12, 31, 12, 13, 13, 38, 13, 14, 14, 15, 15, 35, 15, 32, 16, 51, 16, 17, 17, 42, 17, 18, 18, 21, 18, 20, 19, 29, 19, 24, 19, 20, 20, 21, 21, 22, 22, 41, 22, 23, 23, 61, 24, 52, 24, 25, 25, 58, 25, 53, 26, 28, 26, 55, 27, 54, 27, 28, 29, 59, 29, 60, 30, 62, 30, 49, 31, 45, 31, 32, 32, 33, 33, 46, 34, 37, 34, 35, 35, 36, 36, 37, 38, 44, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 45, 50, 45, 46, 46, 47, 47, 48, 48, 63, 48, 49, 49, 50, 51, 55, 51, 52, 52, 53, 53, 54, 54, 55, 56, 63, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 0, 1, 2, 0, 2, 4, 0, 4, 15, 1, 8, 9, 1, 2, 25, 3, 22, 23, 3, 7, 30, 3, 23, 30, 4, 5, 33, 5, 47, 48, 6, 16, 17, 6, 16, 26, 6, 8, 11, 7, 12, 13, 7, 12, 31, 8, 9, 10, 9, 10, 14, 10, 11, 13, 12, 13, 14, 16, 17, 18, 17, 18, 21, 18, 20, 21, 19, 20, 21, 19, 24, 25, 24, 25, 52, 26, 27, 28, 29, 59, 60, 30, 48, 49, 31, 32, 33, 34, 35, 36, 38, 39, 40, 45, 46, 47, 51, 52, 53, 56, 57, 58, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0, 3, 0, 3, 0, 4, 0, 4, 0, 0, 0, 4, 0, 1, 0, 5, 0, 6, 0, 6, 0, 7, 0, 7, 0, 5, 0, 8, 0, 2, 0, 1, 0, 8, 0, 1, 0, 9, 0, 9, 0, 8, 0, 10, 0, 11, 0, 11, 0, 12, 0, 12, 0, 10, 0, 13, 0, 14, 0, 14, 0, 6, 0, 6, 0, 13, 0, 15, 0, 12, 0, 12, 0, 3, 0, 3, 0, 15, 0, 3, 0, 16, 0, 16, 0, 15, 0, 16, 0, 17, 0, 17, 0, 15, 0, 17, 0, 12, 0, 18, 0, 14, 0, 13, 0, 18, 0, 13, 0, 17, 0, 17, 0, 18, 0, 16, 0, 18, 0, 16, 0, 2, 0, 2, 0, 18, 0, 19, 0, 11, 0, 10, 0, 19, 0, 10, 0, 20, 0, 20, 0, 19, 0, 20, 0, 21, 0, 21, 0, 19, 0, 22, 0, 23, 0, 23, 0, 19, 0, 19, 0, 22, 0, 21, 0, 22, 0, 20, 0, 22, 0, 20, 0, 5, 0, 5, 0, 22, 0, 7, 0, 22, 0, 24, 0, 19, 0, 23, 0, 24, 0, 23, 0, 4, 0, 4, 0, 24, 0, 25, 0, 12, 0, 11, 0, 25, 0, 25, 0, 4, 0, 3, 0, 25, 0, 26, 0, 23, 0, 22, 0, 26, 0, 27, 0, 7, 0, 6, 0, 27, 0, 28, 0, 14, 0, 18, 0, 28, 0, 2, 0, 28, 0, 8, 0, 28, 0, 29, 0, 0, 0, 2, 0, 29, 0, 16, 0, 29, 0, 3, 0, 29, 0, 30, 0, 17, 0, 13, 0, 30, 0, 6, 0, 30, 0, 5, 0, 30, 0, 20, 0, 30, 0, 10, 0, 30, 0, 12, 0, 30, 0, 31, 0, 14, 0, 28, 0, 31, 0, 8, 0, 31, 0, 9, 0, 31, 0, 9, 0, 27, 0, 27, 0, 31, 0, 6, 0, 31, 0, 32, 0, 11, 0, 19, 0, 32, 0, 24, 0, 32, 0, 4, 0, 32, 0, 25, 0, 32, 0, 33, 0, 9, 0, 1, 0, 33, 0, 4, 0, 33, 0, 23, 0, 33, 0, 26, 0, 33, 0, 22, 0, 33, 0, 7, 0, 33, 0, 27, 0, 33, 0, 0, 0, 0, 0, 218, 228, 48, 189, 9, 128, 49, 189, 5, 193, 131, 189, 136, 243, 48, 61, 68, 191, 214, 61, 86, 49, 85, 61, 223, 165, 102, 58, 107, 137, 89, 54, 229, 84, 132, 178, 228, 0, 23, 48, 229, 84, 132, 178, 175, 229, 165, 53, 38, 238, 16, 52, 228, 0, 23, 48, 38, 238, 16, 52, 35, 122, 56, 54, 102, 29, 148, 57, 49, 88, 25, 61, 13, 187, 76, 188, 0, 0, 128, 63, 73, 67, 69, 1, 83, 85, 80, 77, 0, 0, 0, 0, 73, 67, 69, 1, 71, 65, 85, 83, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 33, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 33, 33, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 33, 33, 33, 33, 6, 6, 6, 6, 6, 6, 6, 6, 27, 27, 27, 33, 33, 33, 33, 33, 6, 6, 6, 6, 6, 6, 6, 6, 27, 27, 9, 9, 9, 9, 9, 33, 6, 6, 6, 6, 6, 6, 6, 6, 27, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 14, 14, 14, 14, 31, 9, 9, 9, 9, 9, 9, 9, 13, 13, 13, 14, 14, 14, 14, 14, 31, 8, 8, 8, 8, 8, 8, 8, 13, 13, 14, 14, 14, 14, 14, 14, 31, 8, 8, 8, 8, 8, 8, 8, 13, 13, 14, 14, 14, 14, 14, 14, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 14, 14, 14, 14, 14, 14, 8, 8, 8, 8, 8, 8, 8, 8, 13, 13, 14, 14, 14, 14, 14, 28, 8, 8, 8, 8, 8, 8, 8, 8, 13, 14, 14, 14, 14, 14, 14, 28, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 32, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 32, 32, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 32, 32, 32, 32, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 25, 32, 32, 32, 32, 32, 12, 12, 12, 12, 12, 12, 12, 12, 25, 25, 32, 32, 32, 32, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 25, 4, 4, 4, 4, 4, 4, 4, 15, 15, 15, 15, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 15, 15, 15, 15, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 3, 3, 3, 29, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 3, 3, 3, 29, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 3, 3, 29, 29, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 17, 17, 17, 17, 13, 13, 13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 16, 17, 17, 17, 18, 13, 13, 13, 13, 13, 14, 15, 15, 15, 15, 16, 16, 16, 16, 18, 18, 18, 18, 13, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 14, 14, 14, 3, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 14, 14, 14, 3, 3, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 14, 14, 14, 29, 29, 29, 16, 16, 16, 16, 16, 18, 18, 18, 18, 28, 28, 14, 14, 29, 29, 29, 29, 29, 16, 16, 2, 2, 18, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 11, 10, 19, 19, 19, 19, 21, 21, 21, 21, 22, 22, 22, 22, 5, 7, 11, 19, 19, 19, 19, 19, 21, 21, 21, 21, 22, 22, 22, 22, 7, 7, 11, 19, 19, 19, 19, 19, 21, 21, 21, 22, 22, 22, 22, 22, 22, 7, 11, 19, 19, 19, 19, 19, 19, 21, 21, 22, 22, 22, 22, 22, 22, 7, 11, 19, 19, 19, 19, 19, 19, 21, 21, 22, 22, 22, 22, 22, 22, 7, 11, 19, 19, 19, 19, 19, 19, 19, 22, 22, 22, 22, 22, 22, 22, 7, 11, 19, 19, 19, 19, 19, 19, 19, 22, 22, 22, 22, 22, 22, 22, 7, 11, 19, 19, 19, 19, 19, 19, 19, 22, 22, 22, 22, 22, 22, 22, 7, 11, 11, 11, 32, 32, 32, 32, 4, 4, 4, 0, 0, 0, 0, 0, 0, 19, 11, 11, 32, 32, 32, 32, 4, 4, 4, 0, 0, 0, 0, 0, 0, 19, 19, 11, 32, 32, 32, 32, 4, 4, 4, 0, 0, 0, 0, 0, 0, 19, 19, 19, 32, 32, 32, 32, 32, 4, 4, 0, 0, 0, 0, 0, 0, 19, 19, 19, 24, 32, 32, 32, 32, 4, 4, 0, 0, 0, 0, 0, 0, 19, 19, 19, 24, 24, 32, 32, 32, 4, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19, 24, 24, 24, 32, 32, 4, 0, 0, 0, 0, 0, 1, 1, 19, 19, 19, 24, 24, 24, 24, 24, 4, 1, 1, 1, 1, 1, 1, 1, 22, 22, 22, 23, 23, 26, 26, 26, 9, 1, 1, 1, 1, 1, 1, 1, 22, 22, 22, 26, 26, 26, 26, 33, 9, 8, 8, 8, 8, 1, 1, 1, 22, 22, 22, 26, 26, 33, 33, 33, 9, 8, 8, 8, 8, 8, 8, 8, 22, 22, 22, 26, 33, 33, 33, 33, 9, 8, 8, 8, 8, 8, 8, 8, 22, 22, 22, 33, 33, 33, 33, 33, 9, 9, 8, 8, 8, 8, 8, 8, 22, 22, 7, 33, 33, 33, 33, 33, 9, 9, 8, 8, 8, 8, 8, 8, 22, 7, 7, 33, 33, 33, 33, 33, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, 7, 33, 33, 33, 33, 33, 9, 9, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10, 10, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10, 10, 12, 12, 12, 15, 15, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10, 10, 10, 12, 12, 15, 15, 15, 15, 15, 15, 15, 20, 20, 20, 10, 10, 10, 10, 12, 15, 15, 15, 15, 15, 15, 15, 17, 20, 20, 20, 20, 20, 10, 10, 12, 17, 17, 17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 20, 20, 20, 10, 30, 17, 17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 20, 20, 20, 5, 30, 30, 17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 5, 5, 5, 6, 30, 13, 13, 13, 13, 13, 13, 13, 20, 20, 5, 5, 5, 5, 5, 6, 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 6, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 13, 13, 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, 0, 29, 29, 3, 3, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 29, 3, 3, 3, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 29, 3, 3, 3, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 15, 15, 15, 15, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 15, 15, 15, 15, 4, 4, 4, 4, 4, 4, 4, 25, 12, 12, 12, 12, 12, 12, 12, 12, 4, 4, 32, 32, 32, 32, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 32, 32, 32, 32, 32, 25, 25, 25, 12, 12, 12, 12, 12, 12, 12, 12, 32, 32, 32, 32, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 32, 32, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 32, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 8, 8, 28, 14, 14, 14, 14, 14, 14, 13, 8, 8, 8, 8, 8, 8, 8, 8, 28, 14, 14, 14, 14, 14, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 14, 14, 14, 14, 14, 14, 13, 13, 8, 8, 8, 8, 8, 8, 8, 8, 14, 14, 14, 14, 14, 14, 13, 13, 8, 8, 8, 8, 8, 8, 8, 31, 14, 14, 14, 14, 14, 14, 13, 13, 8, 8, 8, 8, 8, 8, 8, 31, 14, 14, 14, 14, 14, 13, 13, 13, 9, 9, 9, 9, 9, 9, 9, 31, 14, 14, 14, 14, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 27, 6, 6, 6, 6, 6, 6, 6, 6, 33, 9, 9, 9, 9, 9, 27, 27, 6, 6, 6, 6, 6, 6, 6, 6, 33, 33, 33, 33, 33, 27, 27, 27, 6, 6, 6, 6, 6, 6, 6, 6, 33, 33, 33, 33, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 33, 33, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 33, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 7, 22, 22, 22, 22, 22, 22, 22, 19, 19, 19, 19, 19, 19, 19, 11, 7, 22, 22, 22, 22, 22, 22, 22, 19, 19, 19, 19, 19, 19, 19, 11, 7, 22, 22, 22, 22, 22, 22, 22, 19, 19, 19, 19, 19, 19, 19, 11, 7, 22, 22, 22, 22, 22, 22, 21, 21, 19, 19, 19, 19, 19, 19, 11, 7, 22, 22, 22, 22, 22, 22, 21, 21, 19, 19, 19, 19, 19, 19, 11, 7, 22, 22, 22, 22, 22, 22, 21, 21, 21, 19, 19, 19, 19, 19, 11, 7, 7, 22, 22, 22, 22, 21, 21, 21, 21, 19, 19, 19, 19, 19, 11, 7, 5, 22, 22, 22, 22, 21, 21, 21, 21, 19, 19, 19, 19, 10, 11, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 28, 28, 28, 28, 28, 28, 18, 2, 2, 16, 16, 29, 29, 29, 29, 29, 14, 14, 28, 28, 18, 18, 18, 18, 16, 16, 16, 16, 16, 29, 29, 29, 14, 14, 14, 18, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 3, 3, 14, 14, 14, 18, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 3, 14, 14, 14, 18, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 15, 15, 14, 14, 13, 13, 18, 18, 18, 18, 16, 16, 16, 16, 15, 15, 15, 15, 14, 13, 13, 13, 13, 13, 18, 17, 17, 17, 16, 15, 15, 15, 15, 15, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 15, 15, 15, 15, 15, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 6, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 5, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 5, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13, 6, 6, 6, 5, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13, 13, 6, 5, 5, 5, 5, 5, 20, 20, 13, 13, 13, 13, 13, 13, 13, 30, 6, 5, 5, 5, 20, 20, 20, 20, 17, 17, 17, 17, 17, 17, 30, 30, 5, 20, 20, 20, 20, 20, 20, 20, 17, 17, 17, 17, 17, 17, 17, 30, 10, 20, 20, 20, 20, 20, 20, 20, 17, 17, 17, 17, 17, 17, 17, 17, 12, 10, 10, 20, 20, 20, 20, 20, 17, 15, 15, 15, 15, 15, 15, 15, 12, 10, 10, 10, 10, 20, 20, 20, 15, 15, 15, 15, 15, 15, 15, 12, 12, 10, 10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 12, 12, 12, 10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 12, 12, 12, 10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 12, 12, 12, 12, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 12, 12, 12, 12, 10, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 9, 9, 33, 33, 33, 33, 33, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 33, 33, 33, 33, 33, 7, 7, 22, 8, 8, 8, 8, 8, 8, 9, 9, 33, 33, 33, 33, 33, 7, 22, 22, 8, 8, 8, 8, 8, 8, 9, 9, 33, 33, 33, 33, 33, 22, 22, 22, 8, 8, 8, 8, 8, 8, 8, 9, 33, 33, 33, 33, 26, 22, 22, 22, 8, 8, 8, 8, 8, 8, 8, 9, 33, 33, 33, 26, 26, 22, 22, 22, 1, 1, 1, 8, 8, 8, 8, 9, 33, 26, 26, 26, 26, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 9, 26, 26, 26, 23, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 4, 24, 24, 24, 24, 24, 19, 19, 19, 1, 1, 0, 0, 0, 0, 0, 4, 32, 32, 24, 24, 24, 19, 19, 19, 0, 0, 0, 0, 0, 0, 0, 4, 32, 32, 32, 24, 24, 19, 19, 19, 0, 0, 0, 0, 0, 0, 4, 4, 32, 32, 32, 32, 24, 19, 19, 19, 0, 0, 0, 0, 0, 0, 4, 4, 32, 32, 32, 32, 32, 19, 19, 19, 0, 0, 0, 0, 0, 0, 4, 4, 4, 32, 32, 32, 32, 11, 19, 19, 0, 0, 0, 0, 0, 0, 4, 4, 4, 32, 32, 32, 32, 11, 11, 19, 0, 0, 0, 0, 0, 0, 4, 4, 4, 32, 32, 32, 32, 11, 11, 11, 73, 67, 69, 1, 86, 65, 76, 69, 2, 0, 0, 0, 34, 0, 0, 0, 192, 0, 0, 0, 8, 0, 0, 0, 5, 6, 7, 7, 8, 5, 7, 5, 5, 5, 5, 5, 7, 5, 5, 4, 6, 6, 6, 8, 6, 3, 8, 6, 4, 5, 3, 5, 5, 4, 7, 6, 5, 8, 1, 4, 3, 29, 2, 2, 8, 9, 33, 4, 0, 0, 29, 16, 18, 28, 8, 1, 4, 25, 12, 15, 16, 29, 0, 0, 1, 33, 23, 24, 32, 25, 3, 6, 30, 20, 22, 7, 7, 27, 31, 14, 13, 30, 5, 5, 22, 33, 27, 6, 2, 28, 31, 9, 1, 8, 31, 27, 33, 1, 11, 19, 20, 30, 12, 12, 25, 32, 19, 10, 10, 30, 17, 15, 3, 25, 11, 14, 18, 17, 30, 6, 6, 31, 28, 18, 13, 12, 17, 16, 3, 15, 17, 18, 2, 29, 3, 15, 12, 30, 13, 18, 16, 14, 28, 2, 16, 17, 13, 11, 32, 24, 23, 22, 21, 20, 10, 19, 21, 22, 5, 30, 10, 19, 22, 20, 23, 26, 33, 7, 5, 20, 21, 19, 19, 24, 4, 33, 26, 22, 19, 32, 4, 23, 12, 3, 4, 32, 11, 23, 33, 22, 7, 33, 9, 31, 6, 14, 31, 8, 2, 18, 0, 3, 16, 2, 17, 12, 10, 20, 5, 6, 13, 14, 6, 27, 9, 8, 28, 11, 25, 4, 24, 19, 9, 27, 7, 22, 26, 23, 4, 1, 0, 0, 128, 191, 34, 83, 29, 61, 184, 169, 181, 60, 240, 239, 54, 61, 184, 169, 181, 60] + } + } + + over "flange_link" ( + ) + { + } + } +} + diff --git a/techman_tm12/tm12.usda b/techman_tm12/tm12.usda new file mode 100644 index 0000000000000000000000000000000000000000..9b47082520f132c9666460a31aaa9c1e47360a5d --- /dev/null +++ b/techman_tm12/tm12.usda @@ -0,0 +1,426 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/tm12" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/tm12" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/tm12" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.28747, 0.42317006, 1.5700558) + string asset_license = "Unknown - not verified; no permissions asserted" + string asset_name = "tm12" + string asset_type = "robot" + string author = "Techman" + string category = "robotic arm" + string distribution_policy = "Internal handling policy: exclude from redistribution until applicable rights are verified. This policy grants no license or viewing permission." + string license_status = "unverified" + double mass = 29.783599972724915 + string mass_basis = "Sum of positive authored masses of physical rigid bodies, in kilograms; coordinate-only frames excluded. Includes prior estimates; not a measured hardware mass." + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Techman/TM12/tm12.usda" + string usage_clearance = "Pending source-license or rights-holder verification" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "tm12" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +def Xform "tm12" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + } + prepend variantSets = ["PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "link_0" + { + over "collisions" + { + over "collisions" + { + token visibility = "invisible" + } + } + } + + over "link_1" + { + over "collisions" + { + over "collisions_1" + { + token visibility = "invisible" + } + } + } + + over "link_2" + { + over "collisions" + { + over "collisions_2" + { + token visibility = "invisible" + } + } + } + + over "link_3" + { + over "collisions" + { + over "collisions_3" + { + token visibility = "invisible" + } + } + } + + over "link_4" + { + over "collisions" + { + over "collisions_4" + { + token visibility = "invisible" + } + } + } + + over "link_5" + { + over "collisions" + { + over "collisions_5" + { + token visibility = "invisible" + } + } + } + + over "link_6" + { + over "collisions" + { + over "collisions_6" + { + token visibility = "invisible" + } + } + + over "tool0" + { + matrix4d xformOp:transform:agentFrame = ( (0.9999999999999999, 0, -1.2408765038103312e-23, 0), (-6.310887241768095e-30, 0.9999999999999999, 0, 0), (-1.2408752603321579e-23, 5.293955920339377e-23, 0.9999999999999999, 0), (0, 0, 0, 0.9999999999999998) ) + uniform token[] xformOpOrder = ["xformOp:transform:agentFrame"] + } + + over "flange_link" + { + matrix4d xformOp:transform:agentFrame = ( (0.9999999999999999, 0, -1.2408765038103312e-23, 0), (-6.310887241768095e-30, 0.9999999999999999, 0, 0), (-1.2408752603321579e-23, 5.293955920339377e-23, 0.9999999999999999, 0), (0, 0, 0, 0.9999999999999998) ) + uniform token[] xformOpOrder = ["xformOp:transform:agentFrame"] + + over "flange_link_tool0" ( + active = false + ) + { + bool physics:jointEnabled = 0 + } + } + + over "flange_fixed_joint" ( + active = false + ) + { + bool physics:jointEnabled = 0 + } + } + + over "root_joint" ( + active = false + ) + { + bool physics:jointEnabled = 0 + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/ufactory_lite6/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/ufactory_lite6/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..fa2053f9270faa1542d2b644337123b1be95cec6 --- /dev/null +++ b/ufactory_lite6/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:31", + "assets": [ + { + "asset": "lite6.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/ufactory_lite6/.metadata/com.nvidia.simready.packaging.bom.json b/ufactory_lite6/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..972905cfe92f291540fec94c0f0f78e76d58147e --- /dev/null +++ b/ufactory_lite6/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,270 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lite6.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "4cb410eaa9bd9d8f858ad76ce2bf64f709a8915265533b2c8e05c87c48e0d9a3", + "sha256": "5ebebe2426173b16ff57a4eebae9751e899d95e00904c0a3958894143cc8c446" + } + }, + { + "relative_path": ".thumbs/256x256/lite6.usda.png", + "size": 38628, + "hash": { + "sha256-flat-1mb": "dd2233158d438289b7800d6a6635b538b02c9530bd266f2c563b23b146dd7ca7", + "sha256": "9ee91bd7b6dac6bd645217fc5e6509a39328f5c70cb4594043ab017494612f76" + } + }, + { + "relative_path": ".thumbs/lite6.thumb.usd", + "size": 6122, + "hash": { + "sha256-flat-1mb": "2fe227c6d018e2f4401520a72657a9867bdf62d881543fbeeca6bafc6b37a0da", + "sha256": "adf5705dc633d5cd8382d026b3d93266c268a322be33d9f5e8358af57f883d3c" + } + }, + { + "relative_path": "lite6.usda", + "size": 17082, + "hash": { + "sha256-flat-1mb": "04779777bfc6f20588afb2bf0fa9e5c5f602163b0bffa10d72d4acf7f88067ea", + "sha256": "75a30baa33181182cd452073e637099993174c066239730a05a1b4b0b7386229" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 3583, + "hash": { + "sha256-flat-1mb": "13e4c40a36ad4530ca82429c2056edad275785c2302d294e3957b1895f8b605a", + "sha256": "e086efe1e1b5a0693c33db0fbb508fcc88519bdc43cc19d7251b35a14281f063" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 13221, + "hash": { + "sha256-flat-1mb": "37f4d096b33b49bf731f09655d8b87172c1ca017816e18e3851a0b227eab6deb", + "sha256": "00a68725d34a9032557b7fce1eafa21a591ad70066b9ffc94aa1f76bb151a25f" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 4610, + "hash": { + "sha256-flat-1mb": "b59bb6b3a72b1931b9cae13114dc0026877c958dd7702065d611a6de740f0de5", + "sha256": "8983dff138adc0e5a96bf29494f478c84452948206252744c61907d3798f8942" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 182, + "hash": { + "sha256-flat-1mb": "d392f6a450ccc3b70ee9435af34b22ec27a86f2e05875882cfc9f5636f214baf", + "sha256": "9fdf02f90c92f16455e316ef9f4caa71de16a9cdbb9b990dae4640c495678bf6" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/uf_lite_gripper.usd", + "size": 2295, + "hash": { + "sha256-flat-1mb": "bd3a7f0635d079adcd4a88f3b9c284f00754b97fd80f7096456f54599dfe060b", + "sha256": "498bdfafa24eb2f4b90c07a9d370f70fc2693152825577bf3d25c769e39a7814" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/uf_lite_gripper_base.usd", + "size": 802498, + "hash": { + "sha256-flat-1mb": "dd67f6aaeecca097d6416b6866dbfc958b5a42df75414d370d6d079523bc3d41", + "sha256": "871cd780830c10af9dab62fc71f3a7b06ede99bff6b860ce5a104566f1dedf87" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/uf_lite_gripper_physics.usd", + "size": 6506, + "hash": { + "sha256-flat-1mb": "dd6794447666f134842c38b8d4d5b9fdab25b48bde80d6f58c17606baf1f4e12", + "sha256": "606137f17a3fd1afe68f492c40da465ed016bc232e2a3ff9b2a6d4cb3a848280" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/uf_lite_gripper_robot_schema.usd", + "size": 2039, + "hash": { + "sha256-flat-1mb": "5e51408eb491e1265e98062305529e0039065df295165c90dc288f676d37e3a6", + "sha256": "cec1810996a7b5617a5b772275f27ce72ef0e376da10cfe9098aa15bd0bd64f7" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/uf_lite_gripper_sensor.usd", + "size": 692, + "hash": { + "sha256-flat-1mb": "dd61f2ec0d4c80386af3956565d567999c232de5d348c9e0aad547bf3985ed5f", + "sha256": "96c5293acdb1cd776ab64f169b731cdce919dba52f4de1e2cd80d8dbc6e1a6da" + } + }, + { + "relative_path": "payloads/Variant_Set/lite_gripper.usda", + "size": 518, + "hash": { + "sha256-flat-1mb": "9be7275377f607be46019046520bef105fa72f99c27c02a9c6640ebb68b2b994", + "sha256": "235984f413e0de68fcc684e353e39997772aec29fb84ecc1420ceb592904d20b" + } + }, + { + "relative_path": "payloads/Variant_Set/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 17649, + "hash": { + "sha256-flat-1mb": "2e0b719c026f6e6a9bfc1338e8ec67007e7421bbd5d2ec8b8f5b919593fd67b9", + "sha256": "8f1a7e5f521872eb514cfbd951b2616f6c5f11f96e5bf762dd50c44c24832936" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 4696112, + "hash": { + "sha256-flat-1mb": "29edc1dc326a1ba86f84a7c6ac358b462811540470f665134b68958a1d6627ef", + "sha256": "057712586307beee5fc3c13be3f31ad29b8e8da34a7a47c692fd58e491526ce3", + "sha256-first1m": "e7a06fffdf8b78778114b9b3453335c0540c192f89db97a778c261a08642f295" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 24009, + "hash": { + "sha256-flat-1mb": "c774d124d895550f66df191705ab60502b86a3af6287a7c29542f6995d608b80", + "sha256": "16e703cfdee8868ca52a619b473663d6367196025f10e780b0b0a6452424511b" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 20135, + "hash": { + "sha256-flat-1mb": "505b07f0f8173b2c04745d3111848889c1c1169bc82ebd496d67782657689fb0", + "sha256": "1ba0db8ee93ce852782b19ebf027685caabf20ea337ea419366ab81f117564e9" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 6188, + "hash": { + "sha256-flat-1mb": "adb272a6c5e537f0296c0c8aa16b1ce1978e0b48643deeb145133ad2c4cc2012", + "sha256": "1083dcc99bfa04dbb25d76d92ab3d43aca34f0f6b87dad38054823d56754bbfb" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8253, + "hash": { + "sha256-flat-1mb": "200a7cb22ac5f95750d3bc1df3be0d1fa65c0bb71a3a33655e42ccf2a77f5800", + "sha256": "e7e37b2d19650f3468108b1046448c2870abde080dbf1af899743c8f146f1f53" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4944, + "hash": { + "sha256-flat-1mb": "45e5cd93fa35d8f013e1ba09ac4c2b7a8e12e1adc97dedf9bef90f8d8f207a0b", + "sha256": "909da51cf0ba7479687769732e179c25618ff5ad6f18b5c9b507019a9be83230" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 6349, + "hash": { + "sha256-flat-1mb": "e8666cdf1682ab77004904add7960addad88969d2e5b5a50a4f894c5c85c8969", + "sha256": "eae72c30363d1729ae94218ee5d9b8809bd9d436f00b92637d083528a40cb13c" + } + } + ] +} \ No newline at end of file diff --git a/ufactory_lite6/.metadata/com.nvidia.simready.root_usds.json b/ufactory_lite6/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..70673597e01d1cebab553c54aa4cc24b0053ebf3 --- /dev/null +++ b/ufactory_lite6/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lite6.usda" + ] +} diff --git a/ufactory_lite6/.simready/validation.json b/ufactory_lite6/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/ufactory_lite6/.simready/validation.json @@ -0,0 +1,223 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/ufactory_lite6/.thumbs/256x256/.lite6.usda.last_generated b/ufactory_lite6/.thumbs/256x256/.lite6.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..10abb244e3db09114fc1d93ec96338d1b6d741d0 --- /dev/null +++ b/ufactory_lite6/.thumbs/256x256/.lite6.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:43:20 \ No newline at end of file diff --git a/ufactory_lite6/.thumbs/256x256/lite6.usda.png b/ufactory_lite6/.thumbs/256x256/lite6.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..46672d44e991fd9616622fa11d86fa53126fca92 --- /dev/null +++ b/ufactory_lite6/.thumbs/256x256/lite6.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ee91bd7b6dac6bd645217fc5e6509a39328f5c70cb4594043ab017494612f76 +size 38628 diff --git a/ufactory_lite6/.thumbs/lite6.thumb.usd b/ufactory_lite6/.thumbs/lite6.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..e0fa85f2bd9476d1eafe0133bc7b0711846f48b0 Binary files /dev/null and b/ufactory_lite6/.thumbs/lite6.thumb.usd differ diff --git a/ufactory_lite6/com.nvidia.simready.packaging.json b/ufactory_lite6/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..26165aede0c2c076b25a9c7bd4adfab64be5518b --- /dev/null +++ b/ufactory_lite6/com.nvidia.simready.packaging.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.0", + "package_id": "ufactory_lite6.1.0.0", + "license": "unknown", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "171a243373cc3391f96a175fd66ec18b30eccc9a7e7f29f939c562c8005c8dbe" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "098074df39354ccc6c0acf753c3b0e7e321e346b0a81d46edde94acd8cceb571" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "adc32d994e771f9e76f2862f5c0a85e0205c47ba5bf244dedb538533e8d03730" + } + } + ], + "content_hash": { + "sha256": "8fe8b9eff0a401944e475dff6505267b045bbb14385ac561930a9328a35058e4" + }, + "package_hash": { + "sha256": "bbe37fc19f1194d3cd0fe09df4c1d608828ef6cf2be7a80bb184417a1be19903" + } +} \ No newline at end of file diff --git a/ufactory_lite6/lite6.usda b/ufactory_lite6/lite6.usda new file mode 100644 index 0000000000000000000000000000000000000000..53c513c94c32c97cc4c118b49c172f933cce525b --- /dev/null +++ b/ufactory_lite6/lite6.usda @@ -0,0 +1,452 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.24773322, 0.20719384, 0.48370063) + string asset_license = "Unknown - not verified; no permissions asserted" + string asset_name = "lite6" + string asset_type = "robot" + string author = "Ufactory" + string category = "robotic arm" + string distribution_policy = "Internal handling policy: exclude from redistribution until applicable rights are verified. This policy grants no license or viewing permission." + string license_status = "unverified" + double mass = 7.575935184955597 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Ufactory/lite6/lite6.usda" + string usage_clearance = "Pending source-license or rights-holder verification" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + string Variant_Set = "none" + } + variantSets = ["Variant_Set", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "world" + { + over "collisions" + { + over "link_base" ( + instanceable = false + ) + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" ( + instanceable = false + ) + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" ( + instanceable = false + ) + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" ( + instanceable = false + ) + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" ( + instanceable = false + ) + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" ( + instanceable = false + ) + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" ( + instanceable = false + ) + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + variantSet "Variant_Set" = { + "lite_gripper" ( + prepend payload = @./payloads/Variant_Set/lite_gripper.usda@ + ) { + + } + "none" ( + prepend payload = @./payloads/Variant_Set/none.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/ufactory_lite6/materials/mdl/LICENSE.md b/ufactory_lite6/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/ufactory_lite6/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/ufactory_lite6/materials/mdl/OmniPBR.mdl b/ufactory_lite6/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/ufactory_lite6/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_lite6/materials/mdl/OmniPBRBase.mdl b/ufactory_lite6/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/ufactory_lite6/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/ufactory_lite6/materials/mdl/OmniPBR_ClearCoat.mdl b/ufactory_lite6/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/ufactory_lite6/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_lite6/materials/mdl/aux_definitions.mdl b/ufactory_lite6/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/ufactory_lite6/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/ufactory_lite6/materials/mdl/core_definitions.mdl b/ufactory_lite6/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/ufactory_lite6/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/ufactory_lite6/materials/mdl/support_definitions.mdl b/ufactory_lite6/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/ufactory_lite6/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/ufactory_lite6/payloads/Physics/mujoco.usda b/ufactory_lite6/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..68648554b36913169336378f02db81701e6b8ce6 --- /dev/null +++ b/ufactory_lite6/payloads/Physics/mujoco.usda @@ -0,0 +1,230 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "joints" + { + over "joint1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "world" + { + over "link_base" + { + } + + over "visuals" + { + over "link_base" + { + } + } + + over "collisions" + { + over "link_base" + { + over "mesh_1" ( + ) + { + } + } + } + } + + over "link1" + { + over "visuals" + { + over "link1" + { + } + } + + over "collisions" + { + over "link1" + { + over "mesh_3" ( + ) + { + } + } + } + } + + over "link2" + { + over "visuals" + { + over "link2" + { + } + } + + over "collisions" + { + over "link2" + { + over "mesh_5" ( + ) + { + } + } + } + } + + over "link3" + { + over "visuals" + { + over "link3" + { + } + } + + over "collisions" + { + over "link3" + { + over "mesh_7" ( + ) + { + } + } + } + } + + over "link4" + { + over "visuals" + { + over "link4" + { + } + } + + over "collisions" + { + over "link4" + { + over "mesh_9" ( + ) + { + } + } + } + } + + over "link5" + { + over "visuals" + { + over "link5" + { + } + } + + over "collisions" + { + over "link5" + { + over "mesh_11" ( + ) + { + } + } + } + } + + over "link6" + { + over "link_eef" + { + } + + over "visuals" + { + over "link6" + { + } + } + + over "collisions" + { + over "link6" + { + over "mesh_13" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + over "material_Silver" + { + } + + over "material_White" + { + } + } + + over "gripper" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/ufactory_lite6/payloads/Physics/none.usda b/ufactory_lite6/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_lite6/payloads/Physics/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_lite6/payloads/Physics/physics.usda b/ufactory_lite6/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..a5ec90dc9114f8d9f1090eab6d1e4599a7f654ed --- /dev/null +++ b/ufactory_lite6/payloads/Physics/physics.usda @@ -0,0 +1,357 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "joints" + { + def PhysicsRevoluteJoint "joint1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.017632693 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 44.081734 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.07053077 + point3f physics:localPos0 = (0, 0, 0.2435) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.01861142 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 46.52855 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.07444568 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (-0.50000364, 0.49999818, 0.5000018, 0.4999964) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -149.99977 + float physics:upperLimit = 149.99977 + } + + def PhysicsRevoluteJoint "joint3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.016816545 + float drive:angular:physics:maxForce = 32 + float drive:angular:physics:stiffness = 42.041363 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.06726618 + point3f physics:localPos0 = (0.2002, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (-0.000002559715, -0.7071055, -0.7071081, -0.0000025597242) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -3.5000272 + float physics:upperLimit = 300 + } + + def PhysicsRevoluteJoint "joint4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.03263876 + float drive:angular:physics:maxForce = 32 + float drive:angular:physics:stiffness = 81.5969 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.13055503 + point3f physics:localPos0 = (0.087, -0.22761, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00041027882 + float drive:angular:physics:maxForce = 32 + float drive:angular:physics:stiffness = 1.025697 + float drive:angular:physics:targetPosition = -43.7 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0016411153 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7020576, 0.70206, -0.08434166, 0.08434134) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -123.99952 + float physics:upperLimit = 123.99952 + } + + def PhysicsRevoluteJoint "joint6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00016746689 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 0.41866723 + float drive:angular:physics:targetPosition = -107.1 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00066986756 + point3f physics:localPos0 = (0, 0.0625, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "world" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (0, 0, 0) + point3f physics:centerOfMass = (-0.008295446, 0.000032635744, 0.063119456) + float3 physics:diagonalInertia = (0, 0, 0) + float physics:mass = 1.6539351 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + vector3f physics:velocity = (0, 0, 0) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (9.002585e-10, -1.276674e-10, 0.0039561703) + point3f physics:centerOfMass = (-0.00036, 0.04195, -0.0025) + float3 physics:diagonalInertia = (0.001452763, 0.00085335504, 0.0013527519) + float physics:mass = 1.411 + quatf physics:principalAxes = (0.99023783, 0.13031231, -0.047194086, -0.014848429) + rel physics:simulationOwner + vector3f physics:velocity = (-0.000002896572, -2.4857313e-8, 6.803013e-13) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link2" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (-6.831267e-9, 0.0007120224, 0.0039561703) + point3f physics:centerOfMass = (0.179, 0, 0.0584) + float3 physics:diagonalInertia = (0.0012201827, 0.0056097126, 0.005215205) + float physics:mass = 1.34 + quatf physics:principalAxes = (0.98822916, 0.0010828195, 0.15297434, -0.00095072406) + rel physics:simulationOwner + vector3f physics:velocity = (-0.000001807959, 2.7090816e-11, -8.0081506e-12) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link3" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (-2.4391571e-8, 0.0023249341, 0.003956159) + point3f physics:centerOfMass = (0.072, -0.0357, -0.001) + float3 physics:diagonalInertia = (0.00070380664, 0.0017554632, 0.0018521) + float physics:mass = 0.953 + quatf physics:principalAxes = (0.9767498, 0.027575074, -0.039178804, -0.20896104) + rel physics:simulationOwner + vector3f physics:velocity = (9.701785e-7, 0.0000049714963, -0.0000029215953) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link4" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (1.299671e-7, 0.0023250042, 0.02299897) + point3f physics:centerOfMass = (-0.002, -0.0285, -0.0813) + float3 physics:diagonalInertia = (0.0037050284, 0.0034909125, 0.0010958592) + float physics:mass = 1.284 + quatf physics:principalAxes = (0.97524774, 0.22109033, 0.0020349806, -0.002621776) + rel physics:simulationOwner + vector3f physics:velocity = (-0.000014889129, 0.0000052041714, -0.0000034489885) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link5" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (0.000002101967, -0.18621254, 0.02299901) + point3f physics:centerOfMass = (0, 0.01, 0.0019) + float3 physics:diagonalInertia = (0.0005675527, 0.00050768093, 0.00052926637) + float physics:mass = 0.804 + quatf physics:principalAxes = (0.9974583, -0.012616283, -0.06992804, -0.005298793) + rel physics:simulationOwner + vector3f physics:velocity = (0.000020635745, 0.000008014293, 0.000012719271) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link6" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + vector3f physics:angularVelocity = (0.012396793, -0.18621251, 0.0015296378) + point3f physics:centerOfMass = (0, -0.0019400001, -0.0102) + float3 physics:diagonalInertia = (0.00007714116, 0.000085775726, 0.00014814812) + float physics:mass = 0.13 + quatf physics:principalAxes = (0.99828994, -0.0050072344, -0.0026026508, 0.058185127) + rel physics:simulationOwner + vector3f physics:velocity = (0.00014348589, 0.000016662809, 0.00007611204) + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} diff --git a/ufactory_lite6/payloads/Physics/physx.usda b/ufactory_lite6/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..ef5745924eec53af7b52f821688acce9e4078d07 --- /dev/null +++ b/ufactory_lite6/payloads/Physics/physx.usda @@ -0,0 +1,205 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "UF_ROBOT" +{ + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + float physxArticulation:sleepThreshold = 0.00001 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + float physxArticulation:stabilizationThreshold = 0.00001 + } +} + diff --git a/ufactory_lite6/payloads/Sensor/none.usda b/ufactory_lite6/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_lite6/payloads/Sensor/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_lite6/payloads/Sensor/sensors.usda b/ufactory_lite6/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..bec5a0cb02e1d3d0710abfcb18049342e3c573be --- /dev/null +++ b/ufactory_lite6/payloads/Sensor/sensors.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" +{ +} + diff --git a/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper.usd b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper.usd new file mode 100644 index 0000000000000000000000000000000000000000..cc141ce3c31a9fee895b122e45e15b62b5f2fdbc Binary files /dev/null and b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper.usd differ diff --git a/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_base.usd b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_base.usd new file mode 100644 index 0000000000000000000000000000000000000000..b125a8a859e2f41e208910d5df889fb5a8381a4f --- /dev/null +++ b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_base.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:871cd780830c10af9dab62fc71f3a7b06ede99bff6b860ce5a104566f1dedf87 +size 802498 diff --git a/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_physics.usd b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_physics.usd new file mode 100644 index 0000000000000000000000000000000000000000..a754c22941e452cabc410844727c369f90d3cbec Binary files /dev/null and b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_physics.usd differ diff --git a/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_robot_schema.usd b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_robot_schema.usd new file mode 100644 index 0000000000000000000000000000000000000000..9f289a23bb30e5ecd9f3329e9623383caca8881f Binary files /dev/null and b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_robot_schema.usd differ diff --git a/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_sensor.usd b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_sensor.usd new file mode 100644 index 0000000000000000000000000000000000000000..3fa9db96add10367578ad90a9e15519c8796bb34 Binary files /dev/null and b/ufactory_lite6/payloads/Variant_Set/dependencies/uf_lite_gripper_sensor.usd differ diff --git a/ufactory_lite6/payloads/Variant_Set/lite_gripper.usda b/ufactory_lite6/payloads/Variant_Set/lite_gripper.usda new file mode 100644 index 0000000000000000000000000000000000000000..2124e2b9b972369c4248c70523700fbbb07ede71 --- /dev/null +++ b/ufactory_lite6/payloads/Variant_Set/lite_gripper.usda @@ -0,0 +1,29 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" ( + customData = { + string[] variantPrimPaths = ["gripper/root_joint", "gripper"] + } +) +{ + over "gripper" ( + prepend payload = @./dependencies/uf_lite_gripper.usd@ + ) + { + over "root_joint" + { + custom rel physics:body0 + prepend rel physics:body0 = + } + } +} + diff --git a/ufactory_lite6/payloads/Variant_Set/none.usda b/ufactory_lite6/payloads/Variant_Set/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_lite6/payloads/Variant_Set/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_lite6/payloads/base.usda b/ufactory_lite6/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..fdd632a3de7de780263c1f2228a90be8741b9eec --- /dev/null +++ b/ufactory_lite6/payloads/base.usda @@ -0,0 +1,507 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + prepend variantSets = "Variant_Set" +) +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + def Material "material_Silver" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.753, 0.753, 0.753) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_White" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Scope "joints" + { + } + + def Xform "world" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_base" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link_base" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link_base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link1" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-2.153683453798294e-9, 0, 0.24349991977214813) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link2" + { + quatd xformOp:orient = (0.5000037178184698, -0.4999982640106412, -0.5000017210799866, -0.4999962970573929) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (9.051291272044182e-9, 7.450580596923828e-9, 0.24349991977214813) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link3" + { + quatd xformOp:orient = (0.7071094158505028, 0.7071041464800262, 0.000006750226020807891, 8.654315024607817e-7) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (7.972121238708496e-7, 3.725290298461914e-9, 0.4436999559402466) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link4" + { + quatd xformOp:orient = (0.0000018106020430222604, 0.9999999999754777, 0.000005344394594299867, -0.000004147761501270149) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0869988426566124, -7.431954145431519e-7, 0.21608927845954895) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link5" + { + quatd xformOp:orient = (0.683015562622295, -0.6830137345468592, -0.18300911713037565, -0.1830017559567745) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.0869988426566124, -7.540220394730568e-7, 0.21608929336071014) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link6" + { + quatd xformOp:orient = (0.2081799910888902, 0.5738746019177682, 0.7769722466193494, 0.15376332647037075) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.11824769526720047, -4.2957253754138947e-7, 0.16196201741695404) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_eef" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link6" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "gripper" + { + quatd xformOp:orient = (6.123233995736766e-17, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.087, 0, 0.15359) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + variantSet "Variant_Set" = { + "lite_gripper" { + over "gripper" + { + over "root_joint" + { + point3f physics:localPos0 = (0.0000014081626, -6.6615524e-7, -5.9605907e-7) + quatf physics:localRot0 = (1, 0.000001758337, 0.0000036445508, 0.0000054147026) + } + + over "uflite_gripper_link" + { + vector3f physics:angularVelocity = (0.012396793, -0.18621251, 0.0015296378) + rel physics:simulationOwner + vector3f physics:velocity = (0.00025360633, 0.000024574341, 0.00014677322) + quatd xformOp:orient = (-0.5738786831088882, 0.20817536887526947, -0.1537651977073509, 0.7769701003519205) + double3 xformOp:translate = (0.031246488273143774, -7.197377271939992e-7, -0.008372002515792842) + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "uflite_finger1" + { + vector3f physics:angularVelocity = (0.012396793, -0.18621251, 0.0015296378) + rel physics:simulationOwner + vector3f physics:velocity = (0.00021069194, -0.000009892217, 0.0001765918) + quatd xformOp:orient = (-0.573878668533603, 0.2081753426459899, -0.15376519273272302, 0.7769701191295533) + double3 xformOp:translate = (0.06250376749038697, -0.0014605638571083591, 0.03628196450710297) + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "uflite_finger2" + { + vector3f physics:angularVelocity = (0.012396793, -0.18621251, 0.0015296378) + rel physics:simulationOwner + vector3f physics:velocity = (0.0004828982, 0.00007230975, 0.00022180262) + quatd xformOp:orient = (-0.5738787122605213, 0.20817529447148173, -0.15376520337960242, 0.7769700976328155) + double3 xformOp:translate = (0.0537100260257721, 0.0016631912440061517, 0.04135873797178269) + + over "collisions" + { + rel physics:simulationOwner + } + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/ufactory_lite6/payloads/geometries.usd b/ufactory_lite6/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..10194c4b4d38beb323ffc9f1b84bc38556fe73bb --- /dev/null +++ b/ufactory_lite6/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057712586307beee5fc3c13be3f31ad29b8e8da34a7a47c692fd58e491526ce3 +size 4696112 diff --git a/ufactory_lite6/payloads/instances.usda b/ufactory_lite6/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..76482459915a633a2fa348361138a57a7f335198 --- /dev/null +++ b/ufactory_lite6/payloads/instances.usda @@ -0,0 +1,702 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" + { + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/ufactory_lite6/payloads/materials.usda b/ufactory_lite6/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..2039a055c8d1248c5ce98f555bc4d7302c2c5c72 --- /dev/null +++ b/ufactory_lite6/payloads/materials.usda @@ -0,0 +1,560 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "material_Black" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Red" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.8, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Silver" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "none" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.753, 0.753, 0.753) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.753, 0.753, 0.753) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_White" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_______________" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "material_______________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.5, 0.5, 0.5) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material____________" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "material____________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/ufactory_lite6/payloads/robot.usda b/ufactory_lite6/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..177e8f53d8d04f9b2eb5c5c4f04730551e0eb0aa --- /dev/null +++ b/ufactory_lite6/payloads/robot.usda @@ -0,0 +1,210 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint2" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint3" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint4" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint5" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float state:angular:physics:position = -43.7 + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint6" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float state:angular:physics:position = -107.1 + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "world" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "link_base" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "link1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link2" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link3" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link4" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link5" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link6" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "link_eef" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } +} diff --git a/ufactory_lite6/runnables/physics/mujoco.usda b/ufactory_lite6/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..96c0165364604c5103e42c7041d0f234509da8a9 --- /dev/null +++ b/ufactory_lite6/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +def "UF_ROBOT" +{ + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_UF_ROBOT_joints_joint1" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -2525.6972948366365, -1.0102788933459736] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 50 + double mjc:forceRange:min = -50 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint2" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -2665.8894957022762, -1.066355813648836] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 50 + double mjc:forceRange:min = -50 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint3" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -2408.792651266912, -0.963517070410539] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 32 + double mjc:forceRange:min = -32 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint4" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -4675.158045205702, -1.8700631060671786] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 32 + double mjc:forceRange:min = -32 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint5" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [-44.82295937114486, -58.76810875094861, -0.023507244954462686] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 32 + double mjc:forceRange:min = -32 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint6" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [-44.839259376056134, -23.987865129253024, -0.00959514596232178] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 20 + double mjc:forceRange:min = -20 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } +} + diff --git a/ufactory_lite6/runnables/physics/newton.usda b/ufactory_lite6/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..69c1682f1327159096f5c02e2359cf127d88f39f --- /dev/null +++ b/ufactory_lite6/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +over "UF_ROBOT" +{ + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 10.4219 + float newton:damping = 0.347398 + float newton:velocityLimit = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 10.4219 + float newton:damping = 0.347398 + float newton:velocityLimit = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 8.3376 + float newton:damping = 0.277919 + float newton:velocityLimit = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 6.67 + float newton:damping = 0.222335 + float newton:velocityLimit = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 6.67 + float newton:damping = 0.222335 + float newton:velocityLimit = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.1688 + float newton:damping = 0.138959 + float newton:velocityLimit = 179.90874 + } + } +} + diff --git a/ufactory_lite6/runnables/physics/physx.usda b/ufactory_lite6/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..483585f92d35ed163dc49b0bec16769e79997d66 --- /dev/null +++ b/ufactory_lite6/runnables/physics/physx.usda @@ -0,0 +1,246 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" ( + prepend variantSets = "Variant_Set" +) +{ + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = -0.0000031772724 + float state:angular:physics:velocity = 0 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0.000022263755 + float state:angular:physics:velocity = 0 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = -0.00006087689 + float state:angular:physics:velocity = 0 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0.0000020674302 + float state:angular:physics:velocity = 0 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = -29.99927 + float state:angular:physics:velocity = 0 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = -107.10002 + float state:angular:physics:velocity = 0 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_1" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_3" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_5" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_7" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_9" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_11" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link6" + { + over "mesh_13" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + float physxArticulation:sleepThreshold = 0.00001 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + float physxArticulation:stabilizationThreshold = 0.00001 + } + + variantSet "Variant_Set" = { + "lite_gripper" { + over "gripper" + { + over "joints" + { + over "finger_joint1" ( + ) + { + float state:linear:physics:position = 0.0049634674 + float state:linear:physics:velocity = 0 + } + + over "finger_joint2" ( + ) + { + float state:linear:physics:position = 0.005660153 + float state:linear:physics:velocity = 0 + } + } + + over "root_joint" ( + ) + { + bool physxArticulation:articulationEnabled = 0 + } + } + } + } + +} diff --git a/ufactory_uf850/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/ufactory_uf850/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..750bc1bb2078ea5a0bf13a984cd916eff163ed3f --- /dev/null +++ b/ufactory_uf850/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:31", + "assets": [ + { + "asset": "uf850.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/ufactory_uf850/.metadata/com.nvidia.simready.packaging.bom.json b/ufactory_uf850/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..90327983cdc22480545fd852391dc067b843382c --- /dev/null +++ b/ufactory_uf850/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,271 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.uf850.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "accd4aea3d8701845e700764ccc3b4f3ed91636a096d3ec4869efe0650015f02", + "sha256": "cf7879fce0711c39c2599b73ec2065e7eea38f0da0e36b00221f531c260979d4" + } + }, + { + "relative_path": ".thumbs/256x256/uf850.usda.png", + "size": 37409, + "hash": { + "sha256-flat-1mb": "88a8ba042ba4c3a67b7107a72a157d7a993d457bdac437646213d0cf786008b9", + "sha256": "7b9bf2090340fa9599c496d73acd4486796d088a446560c6761cc67340d3f5f5" + } + }, + { + "relative_path": ".thumbs/uf850.thumb.usd", + "size": 6122, + "hash": { + "sha256-flat-1mb": "d5d8d3586138f2339ce7c242cc87482cb6c225bd5b274bdbe7965042f4cd57cd", + "sha256": "32742ec7dec2524660eb7e155bb3f06571c6fc2bfdbe846cc5ab50b487c3a27d" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 3531, + "hash": { + "sha256-flat-1mb": "809e3bc5c2bf23d61678bfa591f504c1394602dd55263d81bef790cfec068bfa", + "sha256": "83af1f2677330cffafbac93e5cc0e50722abea64ff0a37f51ad7c6f6b0f9e8cd" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12138, + "hash": { + "sha256-flat-1mb": "e0f86659ddc58611ea8a66605378dabc7dcc5fe4824b6a6ed8eb234c869689e9", + "sha256": "9e4fa18026971cc3601ae17984f55fd499cb985037ad3d01c40018d57ab3c871" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 4501, + "hash": { + "sha256-flat-1mb": "4f6065dc452781b548c0c7ab641c29108d23f53678ba49752a146d53ca0abead", + "sha256": "be1620ca6d1e90e3db71e35f1bd2f94649064ea943cd222e2ac36f6fde305d2f" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 182, + "hash": { + "sha256-flat-1mb": "d392f6a450ccc3b70ee9435af34b22ec27a86f2e05875882cfc9f5636f214baf", + "sha256": "9fdf02f90c92f16455e316ef9f4caa71de16a9cdbb9b990dae4640c495678bf6" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 16483, + "hash": { + "sha256-flat-1mb": "9bfb190b40faace2c392babadd4d21c31024bf5ff3c54fc379c90f7b4cbdbc18", + "sha256": "fa5d8a75ea3d09c98554ea516cd2b0f04f83eb4de7dc578d26d355d0676bb29b" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 12892720, + "hash": { + "sha256-flat-1mb": "698e3448248ec272e3d7e413a6a01ee19ded5045c85ee317fab7aa82e386de58", + "sha256": "06969847925d197763b7696fd0619252f6d8a30a29df2d4f3f743182be5e3de6", + "sha256-first1m": "bc3b137c0dd4f77f6b470aa74d445e4d54a44ca6ef987fd4195f22d3eb197610" + } + }, + { + "relative_path": "payloads/gripper/dependencies/xarm_gripper.usd", + "size": 2289, + "hash": { + "sha256-flat-1mb": "8a2230eac8ee0a8bec7d17f6a8ec38f50ad5bd4d4e696be391bd135ffdb54833", + "sha256": "2f2cf0cc6e5c095066da479f1db5bc499186d2f581dc99645a2f5679a1cb13c8" + } + }, + { + "relative_path": "payloads/gripper/dependencies/xarm_gripper_base.usd", + "size": 5877373, + "hash": { + "sha256-flat-1mb": "2548aec1471528c51078cc810cc8b2b72df3b636cfba04047db8132cd6a73b1a", + "sha256": "1f356bf48592b1fd465d130b588b69d70a5dc5d7c1b7029807ecd9121d243eed", + "sha256-first1m": "c53768699cf9a585fe58518fc7ed99d1a74345748dd69e8bb180962c99e502bc" + } + }, + { + "relative_path": "payloads/gripper/dependencies/xarm_gripper_physics.usd", + "size": 6510, + "hash": { + "sha256-flat-1mb": "f806a943203bd8fc17f04fc627976466f8e8df71ede70c3a2a315c9d044094c9", + "sha256": "6cc389826462267371010b03c1f9e606127dbb8c9183aa74bc1d4a9e95afb634" + } + }, + { + "relative_path": "payloads/gripper/dependencies/xarm_gripper_robot_schema.usd", + "size": 2416, + "hash": { + "sha256-flat-1mb": "8d082eeb2edf321f21ddd3e0f9d157ddf3116bd6499bfa2703112c0b5244b33e", + "sha256": "37d54fb0b752a7e47340f158a8e405c8249203e55e74303d97ffb0a22344102e" + } + }, + { + "relative_path": "payloads/gripper/dependencies/xarm_gripper_sensor.usd", + "size": 690, + "hash": { + "sha256-flat-1mb": "e74238be5d99647cf96bac153e5d855551dd9f994aa9befc9248f611632642bc", + "sha256": "4bed23ef0103ae6cbd63ab013eea59912f48a9c0728203ce2fecac3e56bff233" + } + }, + { + "relative_path": "payloads/gripper/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/gripper/xarm_gripper.usda", + "size": 493, + "hash": { + "sha256-flat-1mb": "8026c94bab7e71b80633aef08c24cb73af4c7d53ba50a5e06b96cb4b44e5c502", + "sha256": "fa79eb9d5a2aacbb183815affba6cfc7dd3ca8e630f3a7f1b407b99e5e853e19" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 25155, + "hash": { + "sha256-flat-1mb": "bf9b851c67be656e4f33b111c6ca3462a97ad6120ed1922a25b65c894ad27912", + "sha256": "ce521eec32aa6da8cdd252048d6300167b17f02cb756e9ec96474d841f3cbe22" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 19891, + "hash": { + "sha256-flat-1mb": "6e6949d78c73dc2cdd132e3412a314ef70ca5d01651189349665f1ab4671a393", + "sha256": "7e5cf3ee796a5dbc1d62c8cfba86ebaed067df1822aae02fb611f006bca9f236" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 6073, + "hash": { + "sha256-flat-1mb": "e5a3ea48026da3ca0d20dd924edc85d3153a06d9e8a504d0fe8a025b27803821", + "sha256": "3a9015f31d9448ce3f898c71e355edf86c1d8633cd65af9ec04a6a786179bd86" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8219, + "hash": { + "sha256-flat-1mb": "c7caffb5182dedb35f8e8a9e1df4b27d5d1d03a0eeaea7c7409c8b61aa9512a7", + "sha256": "60bedc83f8ec2d15f50416be6b8c98a5e07487a52ef27aa0e30366821c254092" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4950, + "hash": { + "sha256-flat-1mb": "dae479041b927d05d5b6bd44e72613619c298219fdc0161951d56382b99af3f5", + "sha256": "00371a570719c6b466d9d28dd2546c4c0cb079eee541e1ed489e6dd02a8cafbf" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 7145, + "hash": { + "sha256-flat-1mb": "829794a3126da2def8f85cc11340ceca7c1c16e9e024289922a44933ab1d1e34", + "sha256": "73df4893b4e845d8e2e113c247014b41e0dbffa8f7c30c0e88c7f0d131c98383" + } + }, + { + "relative_path": "uf850.usda", + "size": 17060, + "hash": { + "sha256-flat-1mb": "7ae4842e3fdd91b785f48db707836e3662751785d6665e12f9b9509bb3d88aea", + "sha256": "af1ed042b4a04b270f7a5715c11a5d640dde406dd38f358e09517fada2d4b645" + } + } + ] +} \ No newline at end of file diff --git a/ufactory_uf850/.metadata/com.nvidia.simready.root_usds.json b/ufactory_uf850/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..f93b7734957eced53d05e123ace5d4259e23cef6 --- /dev/null +++ b/ufactory_uf850/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "uf850.usda" + ] +} diff --git a/ufactory_uf850/.simready/validation.json b/ufactory_uf850/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/ufactory_uf850/.simready/validation.json @@ -0,0 +1,223 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/ufactory_uf850/.thumbs/256x256/.uf850.usda.last_generated b/ufactory_uf850/.thumbs/256x256/.uf850.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..e957c72e89a0bfc64a55ec618a0af9b38ed82c76 --- /dev/null +++ b/ufactory_uf850/.thumbs/256x256/.uf850.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:43:38 \ No newline at end of file diff --git a/ufactory_uf850/.thumbs/256x256/uf850.usda.png b/ufactory_uf850/.thumbs/256x256/uf850.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..81315f5862981541ae7313c7b63ba87c33d01ea7 --- /dev/null +++ b/ufactory_uf850/.thumbs/256x256/uf850.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b9bf2090340fa9599c496d73acd4486796d088a446560c6761cc67340d3f5f5 +size 37409 diff --git a/ufactory_uf850/.thumbs/uf850.thumb.usd b/ufactory_uf850/.thumbs/uf850.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..cf0608273278338f17adb9100750974accf0d1c6 Binary files /dev/null and b/ufactory_uf850/.thumbs/uf850.thumb.usd differ diff --git a/ufactory_uf850/com.nvidia.simready.packaging.json b/ufactory_uf850/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..91b4efd750af038bd7a7b46fa8f67a434ab2abf6 --- /dev/null +++ b/ufactory_uf850/com.nvidia.simready.packaging.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.0", + "package_id": "ufactory_uf850.1.0.0", + "license": "unknown", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "04cf5c7a49baed61a2a8a2b622605dbb75ee74dacde2786a6e833a2be60cdb20" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "582ea19d44157b84c14ebbe2c2902cc20dc35df90492274cede98d8fdd3f3409" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "0a3658d0c459866988d5c8421de695c8888070555347ff2bcf9060165c153f7a" + } + } + ], + "content_hash": { + "sha256": "f5309f95882942369d1c9e5883a6a532f2ba9da003bdf3c4a2d5de7c6eea98f6" + }, + "package_hash": { + "sha256": "a72bd0eefe529dc5c11579d0da2e0e6f11b6fcdd96348a5a08c06c2f6b8567ae" + } +} \ No newline at end of file diff --git a/ufactory_uf850/materials/mdl/LICENSE.md b/ufactory_uf850/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/ufactory_uf850/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/ufactory_uf850/materials/mdl/OmniPBR.mdl b/ufactory_uf850/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/ufactory_uf850/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_uf850/materials/mdl/OmniPBRBase.mdl b/ufactory_uf850/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/ufactory_uf850/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/ufactory_uf850/materials/mdl/OmniPBR_ClearCoat.mdl b/ufactory_uf850/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/ufactory_uf850/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_uf850/materials/mdl/aux_definitions.mdl b/ufactory_uf850/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/ufactory_uf850/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/ufactory_uf850/materials/mdl/core_definitions.mdl b/ufactory_uf850/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/ufactory_uf850/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/ufactory_uf850/materials/mdl/support_definitions.mdl b/ufactory_uf850/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/ufactory_uf850/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/ufactory_uf850/payloads/Physics/mujoco.usda b/ufactory_uf850/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..0eb82516e503279c04e789f3b425907087839297 --- /dev/null +++ b/ufactory_uf850/payloads/Physics/mujoco.usda @@ -0,0 +1,226 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "joints" + { + over "joint1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "world" + { + over "link_base" + { + } + + over "visuals" + { + over "link_base" + { + } + } + + over "collisions" + { + over "link_base" + { + over "mesh_1" ( + ) + { + } + } + } + } + + over "link1" + { + over "visuals" + { + over "link1" + { + } + } + + over "collisions" + { + over "link1" + { + over "mesh_3" ( + ) + { + } + } + } + } + + over "link2" + { + over "visuals" + { + over "link2" + { + } + } + + over "collisions" + { + over "link2" + { + over "mesh_5" ( + ) + { + } + } + } + } + + over "link3" + { + over "visuals" + { + over "link3" + { + } + } + + over "collisions" + { + over "link3" + { + over "mesh_7" ( + ) + { + } + } + } + } + + over "link4" + { + over "visuals" + { + over "link4" + { + } + } + + over "collisions" + { + over "link4" + { + over "mesh_9" ( + ) + { + } + } + } + } + + over "link5" + { + over "visuals" + { + over "link5" + { + } + } + + over "collisions" + { + over "link5" + { + over "mesh_11" ( + ) + { + } + } + } + } + + over "link6" + { + over "link_eef" + { + } + + over "visuals" + { + over "link6" + { + } + } + + over "collisions" + { + over "link6" + { + over "mesh_13" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + over "material_White" + { + } + } + + over "gripper" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/ufactory_uf850/payloads/Physics/none.usda b/ufactory_uf850/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_uf850/payloads/Physics/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_uf850/payloads/Physics/physics.usda b/ufactory_uf850/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..0a098688acfffc08da0994ffb5ffd1b41443d9bf --- /dev/null +++ b/ufactory_uf850/payloads/Physics/physics.usda @@ -0,0 +1,343 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "joints" + { + def PhysicsRevoluteJoint "joint1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.06138062 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 153.45155 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.24552248 + point3f physics:localPos0 = (0, 0, 0.364) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0811291 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 202.82274 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.3245164 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.4999982, 0.5, -0.5, 0.50000185) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -132 + float physics:upperLimit = 132 + } + + def PhysicsRevoluteJoint "joint3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.09535124 + float drive:angular:physics:maxForce = 90 + float drive:angular:physics:stiffness = 238.3781 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.38140497 + point3f physics:localPos0 = (0.39, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (-0.000002559715, -0.7071055, 0.7071081, 0.0000025597242) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -241.99998 + float physics:upperLimit = 3.5000272 + } + + def PhysicsRevoluteJoint "joint4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.20171323 + float drive:angular:physics:maxForce = 68 + float drive:angular:physics:stiffness = 504.28308 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.80685294 + point3f physics:localPos0 = (0.15, 0.426, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0013200231 + float drive:angular:physics:maxForce = 19 + float drive:angular:physics:stiffness = 3.3000576 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0052800924 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -123.99952 + float physics:upperLimit = 123.99952 + } + + def PhysicsRevoluteJoint "joint6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0005221395 + float drive:angular:physics:maxForce = 19 + float drive:angular:physics:stiffness = 1.3053488 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.002088558 + point3f physics:localPos0 = (0, -0.09, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "world" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00025599, -0.0000028579, 0.085749) + float3 physics:diagonalInertia = (0.0063951956, 0.0064375154, 0.004862789) + float physics:mass = 2.2684 + quatf physics:principalAxes = (0.9999299, -0.00007014098, 0.0071282573, 0.009459973) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000057, 0.013842, -0.02055) + float3 physics:diagonalInertia = (0.022001777, 0.018920574, 0.012250252) + float physics:mass = 4.807 + quatf physics:principalAxes = (0.9996244, -0.02734109, -0.0003646353, -0.0018574877) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link2" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.323425, 0.000095, 0.007586) + float3 physics:diagonalInertia = (0.0063730148, 0.0642088, 0.062414408) + float physics:mass = 3.28 + quatf physics:principalAxes = (0.99720037, -0.005803615, 0.07454788, 0.0007007727) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link3" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.128834, 0.11341, 0.00978) + float3 physics:diagonalInertia = (0.014482214, 0.0031273249, 0.015518822) + float physics:mass = 2.237 + quatf physics:principalAxes = (0.8998011, -0.08446463, 0.20050791, -0.3781804) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link4" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000266, -0.03833, -0.101915) + float3 physics:diagonalInertia = (0.019918824, 0.01974966, 0.0020491153) + float physics:mass = 2.041 + quatf physics:principalAxes = (0.9835459, 0.18062553, -0.0011866929, -0.0032372312) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link5" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000057, -0.015267, -0.001015) + float3 physics:diagonalInertia = (0.0020774934, 0.0011091079, 0.002035736) + float physics:mass = 1.385 + quatf physics:principalAxes = (0.99995136, -0.003615741, 0.00879987, -0.002624362) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link6" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000484, -0.000334, -0.014217001) + float3 physics:diagonalInertia = (0.00013367143, 0.00012488605, 0.00023250251) + float physics:mass = 0.225 + quatf physics:principalAxes = (0.94377893, 0.0012695797, 0.0021827219, -0.3305676) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} diff --git a/ufactory_uf850/payloads/Physics/physx.usda b/ufactory_uf850/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..19b008a9c8ecdf4e0761d6f7ab9abb5635582634 --- /dev/null +++ b/ufactory_uf850/payloads/Physics/physx.usda @@ -0,0 +1,203 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "UF_ROBOT" +{ + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 9.6 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 12.1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 5.5 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 2.2 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 3.2 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1.1 + float physxJoint:maxJointVelocity = 179.90874 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/ufactory_uf850/payloads/Sensor/none.usda b/ufactory_uf850/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_uf850/payloads/Sensor/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_uf850/payloads/Sensor/sensors.usda b/ufactory_uf850/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..bec5a0cb02e1d3d0710abfcb18049342e3c573be --- /dev/null +++ b/ufactory_uf850/payloads/Sensor/sensors.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" +{ +} + diff --git a/ufactory_uf850/payloads/base.usda b/ufactory_uf850/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..5f19b563f2a22a7777141160922b843130853a54 --- /dev/null +++ b/ufactory_uf850/payloads/base.usda @@ -0,0 +1,510 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + prepend variantSets = "gripper" +) +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + def Material "material_White" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Scope "joints" + { + } + + def Xform "world" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_base" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link_base" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link_base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link1" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.36399999260902405) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link2" + { + quatd xformOp:orient = (0.49999821186065674, 0.5, -0.5, 0.500001847743988) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.36399999260902405) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link3" + { + quatd xformOp:orient = (0.7071042656898499, -0.7071094512939453, -0.0000012798620900866808, 0.0000012814998626708984) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.0000014007091522216797, 1.4901161193847656e-8, 0.7539999485015869) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link4" + { + quatd xformOp:orient = (-0.0000054836273193359375, -1.0000001192092896, -0.0000018111563804268371, 1.1547740541573148e-9) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.14999867975711823, -0.000002463348437231616, 0.32799986004829407) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link5" + { + quatd xformOp:orient = (-0.7071120142936707, -0.7071017026901245, -0.0000012814952015105519, -0.0000012798668649338651) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.14999867975711823, -0.000002463348437231616, 0.32799986004829407) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link6" + { + quatd xformOp:orient = (-0.0000054836273193359375, -1.0000001192092896, -0.0000018111564941136749, 1.1546603673195932e-9) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.14999867975711823, -0.0000037937245451757917, 0.237999826669693) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_eef" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link6" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "gripper" + { + quatd xformOp:orient = (6.123233995736766e-17, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.15, 0, 0.238) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + variantSet "gripper" = { + "xarm_gripper" { + over "gripper" + { + over "left_finger" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "left_inner_knuckle" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "left_outer_knuckle" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "right_finger" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "right_inner_knuckle" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "right_outer_knuckle" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "xarm_gripper_base_link" + { + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + } + } + + over "root_joint" + { + point3f physics:localPos0 = (0.0000013262171, -0.0000037937177, -1.7885554e-7) + quatf physics:localRot0 = (1, 0.0000054836273, 1.1546603e-9, 0.0000018111563) + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/ufactory_uf850/payloads/geometries.usd b/ufactory_uf850/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..9c16fcbc34b72833bc4d031342c6d14c32cfe43c --- /dev/null +++ b/ufactory_uf850/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06969847925d197763b7696fd0619252f6d8a30a29df2d4f3f743182be5e3de6 +size 12892720 diff --git a/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper.usd b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper.usd new file mode 100644 index 0000000000000000000000000000000000000000..933669a241cde9df955f2963050de2b1bb6a96ad Binary files /dev/null and b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper.usd differ diff --git a/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_base.usd b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_base.usd new file mode 100644 index 0000000000000000000000000000000000000000..c28f99c5cec74704bb9919fa6eb95664e62dacff --- /dev/null +++ b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_base.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f356bf48592b1fd465d130b588b69d70a5dc5d7c1b7029807ecd9121d243eed +size 5877373 diff --git a/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_physics.usd b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_physics.usd new file mode 100644 index 0000000000000000000000000000000000000000..99d2b234fd313aa3930b608b139e13a0aa6a07ae Binary files /dev/null and b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_physics.usd differ diff --git a/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_robot_schema.usd b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_robot_schema.usd new file mode 100644 index 0000000000000000000000000000000000000000..7bfb6ce8374e2b1f6b45f3bc70175cb6898af8a0 Binary files /dev/null and b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_robot_schema.usd differ diff --git a/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_sensor.usd b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_sensor.usd new file mode 100644 index 0000000000000000000000000000000000000000..03b5d0ef4d25265a2b5ad0e84760b55a1699cfe8 Binary files /dev/null and b/ufactory_uf850/payloads/gripper/dependencies/xarm_gripper_sensor.usd differ diff --git a/ufactory_uf850/payloads/gripper/none.usda b/ufactory_uf850/payloads/gripper/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_uf850/payloads/gripper/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_uf850/payloads/gripper/xarm_gripper.usda b/ufactory_uf850/payloads/gripper/xarm_gripper.usda new file mode 100644 index 0000000000000000000000000000000000000000..9fa611105ed8fc4909a497236c18e2382525016c --- /dev/null +++ b/ufactory_uf850/payloads/gripper/xarm_gripper.usda @@ -0,0 +1,29 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" ( + customData = { + string[] variantPrimPaths = ["gripper"] + } +) +{ + over "gripper" ( + prepend payload = @./dependencies/xarm_gripper.usd@ + ) + { + over "root_joint" + { + custom rel physics:body0 + prepend rel physics:body0 = + } + } +} + diff --git a/ufactory_uf850/payloads/instances.usda b/ufactory_uf850/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..c33bf6479fc2865e028a0851a3af3394f39e126d --- /dev/null +++ b/ufactory_uf850/payloads/instances.usda @@ -0,0 +1,738 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" + { + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" + { + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" + { + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" + { + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/ufactory_uf850/payloads/materials.usda b/ufactory_uf850/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..c4e19a8a17f3772e531642b8b6fc77e2b170e20f --- /dev/null +++ b/ufactory_uf850/payloads/materials.usda @@ -0,0 +1,557 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "material_Black" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Red" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.8, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Silver" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.753, 0.753, 0.753) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.753, 0.753, 0.753) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_White" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_______________" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "material_______________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.5, 0.5, 0.5) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "DefaultMaterial" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/ufactory_uf850/payloads/robot.usda b/ufactory_uf850/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..6058df3e362779c457ce867e92e80b36e8407aee --- /dev/null +++ b/ufactory_uf850/payloads/robot.usda @@ -0,0 +1,208 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint2" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint3" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint4" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint5" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint6" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "world" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "link_base" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "link1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link2" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link3" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link4" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link5" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link6" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "link_eef" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } +} diff --git a/ufactory_uf850/runnables/physics/mujoco.usda b/ufactory_uf850/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..09b5633d1ecde14451e3e6161cd746af9f0bcd44 --- /dev/null +++ b/ufactory_uf850/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +def "UF_ROBOT" +{ + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_UF_ROBOT_joints_joint1" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -8792.126366379443, -3.516850529817814] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 200 + double mjc:forceRange:min = -200 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint2" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -11620.886913784443, -4.648354822204348] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 200 + double mjc:forceRange:min = -200 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint3" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -13658.058917066392, -5.463223710943549] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 90 + double mjc:forceRange:min = -90 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint4" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28893.292224287197, -11.557316990801679] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 68 + double mjc:forceRange:min = -68 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint5" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -189.07937547265428, -0.075631751896609] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 19 + double mjc:forceRange:min = -19 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint6" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -74.79097439280065, -0.02991638864721452] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 19 + double mjc:forceRange:min = -19 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } +} + diff --git a/ufactory_uf850/runnables/physics/newton.usda b/ufactory_uf850/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..990a042cdabae191006a46bf2eb248e3253c3109 --- /dev/null +++ b/ufactory_uf850/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +over "UF_ROBOT" +{ + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" + { + over "mesh_13" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 41.6878 + float newton:damping = 1.389593 + float newton:velocityLimit = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 41.6878 + float newton:damping = 1.389593 + float newton:velocityLimit = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 23.4494 + float newton:damping = 0.781646 + float newton:velocityLimit = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 14.1739 + float newton:damping = 0.472462 + float newton:velocityLimit = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 3.9603 + float newton:damping = 0.132011 + float newton:velocityLimit = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 3.9603 + float newton:damping = 0.132011 + float newton:velocityLimit = 179.90874 + } + } +} + diff --git a/ufactory_uf850/runnables/physics/physx.usda b/ufactory_uf850/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..43c5edecc9a010a063ebb1dfa6ca3013c3324e89 --- /dev/null +++ b/ufactory_uf850/runnables/physics/physx.usda @@ -0,0 +1,273 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" ( + prepend variantSets = "gripper" +) +{ + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_1" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_3" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_5" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_7" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_9" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_11" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link6" + { + over "mesh_13" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + variantSet "gripper" = { + "xarm_gripper" { + over "gripper" + { + over "joints" + { + over "drive_joint" ( + ) + { + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "left_inner_knuckle_joint" ( + ) + { + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_inner_knuckle_joint" ( + ) + { + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_outer_knuckle_joint" ( + ) + { + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "left_finger_joint" ( + ) + { + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_finger_joint" ( + ) + { + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "root_joint" ( + ) + { + bool physxArticulation:articulationEnabled = 0 + } + } + } + } + +} + diff --git a/ufactory_uf850/uf850.usda b/ufactory_uf850/uf850.usda new file mode 100644 index 0000000000000000000000000000000000000000..9be9d0adcddd9a658ceee72476de610289aaaa47 --- /dev/null +++ b/ufactory_uf850/uf850.usda @@ -0,0 +1,452 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.2899987, 0.23740397, 0.80408096) + string asset_license = "Unknown - not verified; no permissions asserted" + string asset_name = "uf850" + string asset_type = "robot" + string author = "Ufactory" + string category = "robotic arm" + string distribution_policy = "Internal handling policy: exclude from redistribution until applicable rights are verified. This policy grants no license or viewing permission." + string license_status = "unverified" + double mass = 16.2433999478817 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Ufactory/uf850/uf850.usda" + string usage_clearance = "Pending source-license or rights-holder verification" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + string gripper = "none" + } + variantSets = ["gripper", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "world" + { + over "collisions" + { + over "link_base" ( + instanceable = false + ) + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" ( + instanceable = false + ) + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" ( + instanceable = false + ) + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" ( + instanceable = false + ) + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" ( + instanceable = false + ) + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" ( + instanceable = false + ) + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" ( + instanceable = false + ) + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + variantSet "gripper" = { + "none" ( + prepend payload = @./payloads/gripper/none.usda@ + ) { + + } + "xarm_gripper" ( + prepend payload = @./payloads/gripper/xarm_gripper.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/ufactory_xarm6/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/ufactory_xarm6/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..e2810fbe490c820aca87362ccd6ccd991018f042 --- /dev/null +++ b/ufactory_xarm6/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:31", + "assets": [ + { + "asset": "xarm6.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/ufactory_xarm6/.metadata/com.nvidia.simready.packaging.bom.json b/ufactory_xarm6/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..8d42a13393d605350e53903f0394efb75fb0b506 --- /dev/null +++ b/ufactory_xarm6/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,271 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7624, + "hash": { + "sha256-flat-1mb": "a7577552d107bba3e2e88d4ac9ab06b285605519e0862fae0b43938aa7c0c137", + "sha256": "a6b7af64162fcc6026569f04d9a8f12e4ed432f6656a6941803c8a52a87b74ed" + } + }, + { + "relative_path": ".thumbs/256x256/.xarm6.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "c3d934fba1fe4da80aae8e40b032c53dd0e44d052d462936c0ae87c56b2b84a1", + "sha256": "cdec367ed481fb5652eddac0b2fe06a262175176cd7f595d9211a20e9e4ede18" + } + }, + { + "relative_path": ".thumbs/256x256/xarm6.usda.png", + "size": 39950, + "hash": { + "sha256-flat-1mb": "9764e7d14fcb2f06f61d4617f658a07fb61100ca5fbcdfbb9121ec7325cb23b5", + "sha256": "6e47e19d48c012ef4456c8f0f0152361acd3e019e2ada49184ef3d56401450a5" + } + }, + { + "relative_path": ".thumbs/xarm6.thumb.usd", + "size": 6122, + "hash": { + "sha256-flat-1mb": "af603b83f6c3d06ee0e39d7d79c3871d4586b649541162c5cf9d09f9dae734d9", + "sha256": "0500b7ee5287925bc4f5ae9d7c53aea89c2e8f41b301ba43d7c7299638e2598a" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 7671, + "hash": { + "sha256-flat-1mb": "d70fe1d68daa6a9d1e98b8f979778e578786705684a3ddcb83d3e12b3bb2f0be", + "sha256": "c9e035ce77c52549cd506b5a8d2cd4aad55ea82eb983a4920f6cb73078d9e7c4" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 23953, + "hash": { + "sha256-flat-1mb": "c3ab5088e82448031052b607111d4adbebfc9df5908554e82f574f141bf171be", + "sha256": "9f029fe08c3721375cd28c700637a11e2f2356fe674ea2b271805ed8bfa7bc16" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 11092, + "hash": { + "sha256-flat-1mb": "d346a0c736e640efc67ebadab52b59317c4f773f5707a2b17b5559358c7fc5c7", + "sha256": "42f330fcfa6a3adf8f9a18714ab63fadede15bcac3036284c39ce96d80617d26" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 182, + "hash": { + "sha256-flat-1mb": "d392f6a450ccc3b70ee9435af34b22ec27a86f2e05875882cfc9f5636f214baf", + "sha256": "9fdf02f90c92f16455e316ef9f4caa71de16a9cdbb9b990dae4640c495678bf6" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper.usd", + "size": 2289, + "hash": { + "sha256-flat-1mb": "8a2230eac8ee0a8bec7d17f6a8ec38f50ad5bd4d4e696be391bd135ffdb54833", + "sha256": "2f2cf0cc6e5c095066da479f1db5bc499186d2f581dc99645a2f5679a1cb13c8" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_base.usd", + "size": 5877373, + "hash": { + "sha256-flat-1mb": "2548aec1471528c51078cc810cc8b2b72df3b636cfba04047db8132cd6a73b1a", + "sha256": "1f356bf48592b1fd465d130b588b69d70a5dc5d7c1b7029807ecd9121d243eed", + "sha256-first1m": "c53768699cf9a585fe58518fc7ed99d1a74345748dd69e8bb180962c99e502bc" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_physics.usd", + "size": 6510, + "hash": { + "sha256-flat-1mb": "f806a943203bd8fc17f04fc627976466f8e8df71ede70c3a2a315c9d044094c9", + "sha256": "6cc389826462267371010b03c1f9e606127dbb8c9183aa74bc1d4a9e95afb634" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd", + "size": 2416, + "hash": { + "sha256-flat-1mb": "8d082eeb2edf321f21ddd3e0f9d157ddf3116bd6499bfa2703112c0b5244b33e", + "sha256": "37d54fb0b752a7e47340f158a8e405c8249203e55e74303d97ffb0a22344102e" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd", + "size": 690, + "hash": { + "sha256-flat-1mb": "e74238be5d99647cf96bac153e5d855551dd9f994aa9befc9248f611632642bc", + "sha256": "4bed23ef0103ae6cbd63ab013eea59912f48a9c0728203ce2fecac3e56bff233" + } + }, + { + "relative_path": "payloads/Variant_Set/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Variant_Set/xarm_gripper.usda", + "size": 515, + "hash": { + "sha256-flat-1mb": "561aa7e2cf508fd2fd03e313aa34d04be804227da88b1736de1d35dff4d3ef51", + "sha256": "4aabc6b81e5603b723516b8621243fae3894c39d9377eabfcc08bf3e90164c3f" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 24555, + "hash": { + "sha256-flat-1mb": "28639b9450cbd03a4b1874cc7d70095ba0a318fef11e771c12c40affe2a28441", + "sha256": "411e09b703c7f126af7b808781dc7be98c4a0e1319b134f23a06a708ea031fd3" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 9596098, + "hash": { + "sha256-flat-1mb": "782874cd376e35818621d8083f9c85d350a106bbc18215ed00bcec91c544263f", + "sha256": "e1896ea38c3745d75b87b5220eb16a9ea4647044fac8e3d7e7b61cfc5d1367b2", + "sha256-first1m": "d79b7c105934de90e7934dc8a4f481730133c492ad437bc226e01d850239e936" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 39138, + "hash": { + "sha256-flat-1mb": "4953085559026e7b28b655fa8fb17bbfffb7d14e70eb926da9b8d1af3f20c2b9", + "sha256": "c46bfc9dbb312d920137b204c3071f85bce61e6cd252ac2120b1d54ecee65e24" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 20168, + "hash": { + "sha256-flat-1mb": "c196f3818c7024bee92e8ffaef65b8515da0b2e9d5664c0047b8fe060754ac04", + "sha256": "e6ae335479c1a426975791f74861ac4466567b29ec76647bc59ce19ac7b9ae31" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 17095, + "hash": { + "sha256-flat-1mb": "25a57840453ea561eca7030c5fe3804203a7234bc226f854b4a7ab8f7b687429", + "sha256": "b468725e85354cff2bca9252749473c6e8aa1118b02eb79091a66ab689cf4eaa" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 13289, + "hash": { + "sha256-flat-1mb": "42df5adc8ee082f5616c1034fec47db8118961103008c072480956d03b5b7254", + "sha256": "66ff2dcd8fc712f779d3137d6f581ab395ec788998dad6891095131bfa91f214" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 10658, + "hash": { + "sha256-flat-1mb": "bd9e92066eedfcf4332d0fde79e7555c9d67cc3c91ad86a42aea3283c5b021cb", + "sha256": "86814fb905baf2ad295897b6a04bec637accd0b5b58103a5a7378ce6f3988290" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 12746, + "hash": { + "sha256-flat-1mb": "653939659999fb835e6524c94fd778af9abc608f6fed46e1838645b4a272ca5a", + "sha256": "6a0b8a5f1eb6cbaef1d7065f7bbcb54ad3961765b5942fd1157c23021bd4ff05" + } + }, + { + "relative_path": "xarm6.usda", + "size": 19843, + "hash": { + "sha256-flat-1mb": "47f031388fd2c2a283dc826fec3756b0cac6f8319a0148221786529206c04888", + "sha256": "992a3d9bad5bcc595ab5b72dc14e97239ee8ee25e80675d4342b008b8c933a17" + } + } + ] +} \ No newline at end of file diff --git a/ufactory_xarm6/.metadata/com.nvidia.simready.root_usds.json b/ufactory_xarm6/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..1016cdaacc9c2539a4014e2198128f33520912fc --- /dev/null +++ b/ufactory_xarm6/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "xarm6.usda" + ] +} diff --git a/ufactory_xarm6/.simready/validation.json b/ufactory_xarm6/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..fa9d519c7115ed3d699ca78e5a7960d0f7409003 --- /dev/null +++ b/ufactory_xarm6/.simready/validation.json @@ -0,0 +1,224 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "optional requirements": "['com.nvidia.simready.MUJOCO.DJ.002']", + "passed": false, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/ufactory_xarm6/.thumbs/256x256/.xarm6.usda.last_generated b/ufactory_xarm6/.thumbs/256x256/.xarm6.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..6f0954b2334bde536a50731540f3ec9e713a5919 --- /dev/null +++ b/ufactory_xarm6/.thumbs/256x256/.xarm6.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:43:47 \ No newline at end of file diff --git a/ufactory_xarm6/.thumbs/256x256/xarm6.usda.png b/ufactory_xarm6/.thumbs/256x256/xarm6.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..20ed4059bc8ac019649f2320ddae9877de97fa66 --- /dev/null +++ b/ufactory_xarm6/.thumbs/256x256/xarm6.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e47e19d48c012ef4456c8f0f0152361acd3e019e2ada49184ef3d56401450a5 +size 39950 diff --git a/ufactory_xarm6/.thumbs/xarm6.thumb.usd b/ufactory_xarm6/.thumbs/xarm6.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..960382875bd572bc121f0b98d610ef340f877a9f Binary files /dev/null and b/ufactory_xarm6/.thumbs/xarm6.thumb.usd differ diff --git a/ufactory_xarm6/com.nvidia.simready.packaging.json b/ufactory_xarm6/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..b8816e908056b7763a3cfb4d687629753458becf --- /dev/null +++ b/ufactory_xarm6/com.nvidia.simready.packaging.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.0", + "package_id": "ufactory_xarm6.1.0.0", + "license": "unknown", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "d901c19ab790b5a0c708c94dc209f8c55a580f3d6ed90063ae2c06803a0f35f2" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "0f9bb937bb7f303a6099334be45a26309ccfcb3452d75e67ec34b537f22a0d9c" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "b0f399b1ef06f169d35ca058f2410309f1c7b9fd96c093f3f33de243d56b4fb3" + } + } + ], + "content_hash": { + "sha256": "9f015322dfa3ad32c7ab58a7ef138e7cc0c4ce03a78a8c43401c89320a0ae475" + }, + "package_hash": { + "sha256": "773011e6da494dc9da18ee6026c72075014ed38ab022904476567e5f95e6efa3" + } +} \ No newline at end of file diff --git a/ufactory_xarm6/materials/mdl/LICENSE.md b/ufactory_xarm6/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/ufactory_xarm6/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/ufactory_xarm6/materials/mdl/OmniPBR.mdl b/ufactory_xarm6/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/ufactory_xarm6/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_xarm6/materials/mdl/OmniPBRBase.mdl b/ufactory_xarm6/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/ufactory_xarm6/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/ufactory_xarm6/materials/mdl/OmniPBR_ClearCoat.mdl b/ufactory_xarm6/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/ufactory_xarm6/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_xarm6/materials/mdl/aux_definitions.mdl b/ufactory_xarm6/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/ufactory_xarm6/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/ufactory_xarm6/materials/mdl/core_definitions.mdl b/ufactory_xarm6/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/ufactory_xarm6/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/ufactory_xarm6/materials/mdl/support_definitions.mdl b/ufactory_xarm6/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/ufactory_xarm6/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/ufactory_xarm6/payloads/Physics/mujoco.usda b/ufactory_xarm6/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..da960a490245e4989e77d9ab10d417af56aaab4c --- /dev/null +++ b/ufactory_xarm6/payloads/Physics/mujoco.usda @@ -0,0 +1,427 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + over "drive_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "left_finger_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "left_inner_knuckle_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "right_inner_knuckle_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "right_outer_knuckle_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "right_finger_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "xarm_gripper_base_link" + { + over "link_tcp" + { + } + + over "visuals" + { + over "base_link" + { + } + } + + over "collisions" + { + over "base_link" + { + over "mesh" ( + ) + { + } + } + } + } + + over "left_outer_knuckle" + { + over "visuals" + { + over "left_outer_knuckle" + { + } + } + + over "collisions" + { + over "left_outer_knuckle" + { + over "mesh_2" ( + ) + { + } + } + } + } + + over "left_finger" + { + over "visuals" + { + over "left_finger" + { + } + } + + over "collisions" + { + over "left_finger" + { + over "mesh_4" ( + ) + { + } + } + } + } + + over "left_inner_knuckle" + { + over "visuals" + { + over "left_inner_knuckle" + { + } + } + + over "collisions" + { + over "left_inner_knuckle" + { + over "mesh_6" ( + ) + { + } + } + } + } + + over "right_inner_knuckle" + { + over "visuals" + { + over "right_inner_knuckle" + { + } + } + + over "collisions" + { + over "right_inner_knuckle" + { + over "mesh_8" ( + ) + { + } + } + } + } + + over "right_outer_knuckle" + { + over "visuals" + { + over "right_outer_knuckle" + { + } + } + + over "collisions" + { + over "right_outer_knuckle" + { + over "mesh_10" ( + ) + { + } + } + } + } + + over "right_finger" + { + over "visuals" + { + over "right_finger" + { + } + } + + over "collisions" + { + over "right_finger" + { + over "mesh_12" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + } + + over "joints" + { + over "joint1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "world" + { + over "link_base" + { + } + + over "visuals" + { + over "link_base" + { + } + } + + over "collisions" + { + over "link_base" + { + over "mesh_13" ( + ) + { + } + } + } + } + + over "link1" + { + over "visuals" + { + over "link1" + { + } + } + + over "collisions" + { + over "link1" + { + over "mesh_14" ( + ) + { + } + } + } + } + + over "link2" + { + over "visuals" + { + over "link2" + { + } + } + + over "collisions" + { + over "link2" + { + over "mesh_15" ( + ) + { + } + } + } + } + + over "link3" + { + over "visuals" + { + over "link3" + { + } + } + + over "collisions" + { + over "link3" + { + over "mesh_16" ( + ) + { + } + } + } + } + + over "link4" + { + over "visuals" + { + over "link4" + { + } + } + + over "collisions" + { + over "link4" + { + over "mesh_17" ( + ) + { + } + } + } + } + + over "link5" + { + over "visuals" + { + over "link5" + { + } + } + + over "collisions" + { + over "link5" + { + over "mesh_18" ( + ) + { + } + } + } + } + + over "link6" + { + over "link_eef" + { + } + + over "visuals" + { + over "link6" + { + } + } + + over "collisions" + { + over "end_tool" + { + over "mesh_20" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + over "material_Silver" + { + } + + over "material_White" + { + } + } + + over "VisualMaterials" + { + } +} + diff --git a/ufactory_xarm6/payloads/Physics/none.usda b/ufactory_xarm6/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_xarm6/payloads/Physics/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm6/payloads/Physics/physics.usda b/ufactory_xarm6/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..442ced94e5c58ca12638e325b38cff197cab5713 --- /dev/null +++ b/ufactory_xarm6/payloads/Physics/physics.usda @@ -0,0 +1,647 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + def PhysicsRevoluteJoint "drive_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00021815527 + float drive:angular:physics:maxForce = 1000 + float drive:angular:physics:stiffness = 0.54538816 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0008726211 + point3f physics:localPos0 = (0, 0.035, 0.059098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = 0 + float physics:upperLimit = 48.701412 + } + + def PhysicsRevoluteJoint "left_finger_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00037557803 + point3f physics:localPos0 = (0, 0.035465, 0.042039) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "left_inner_knuckle_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00030888498 + point3f physics:localPos0 = (0, 0.02, 0.074098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "right_inner_knuckle_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0003042112 + point3f physics:localPos0 = (0, -0.02, 0.074098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "right_outer_knuckle_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00081987266 + point3f physics:localPos0 = (0, -0.035, 0.059098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "right_finger_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00037432538 + point3f physics:localPos0 = (0, -0.035465, 0.042039) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + } + + over "xarm_gripper_base_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00065489, -0.0018497001, 0.048028) + float3 physics:diagonalInertia = (0.0004710948, 0.00033230297, 0.0002548022) + float physics:mass = 0.54156 + quatf physics:principalAxes = (0.99740654, 0.07167488, 0.006125353, -0.0023352539) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "left_outer_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (2.9948e-14, 0.021559, 0.015181) + float3 physics:diagonalInertia = (0.000019111, 0.0000019016687, 0.000017908931) + float physics:mass = 0.033618 + quatf physics:principalAxes = (0.95905584, -0.28321707, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "left_finger" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-2.4536e-14, -0.016413, 0.029258) + float3 physics:diagonalInertia = (0.000017493, 0.000018803687, 0.0000035679147) + float physics:mass = 0.048304 + quatf physics:principalAxes = (0.98660403, -0.16313326, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "left_inner_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0000018660079, 0.022046784, 0.026133467) + float3 physics:diagonalInertia = (0.0000060949, 0.000008342161, 0.0000027560097) + float physics:mass = 0.023012578 + quatf physics:principalAxes = (0.9392398, 0.34326172, -0.000004853818, 0.000020194318) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "right_inner_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000001866, -0.022047, 0.026133) + float3 physics:diagonalInertia = (0.0000060949, 0.00000834209, 0.0000027560104) + float physics:mass = 0.023013 + quatf physics:principalAxes = (0.93924576, -0.34324545, -0.0000048531947, -0.000020195002) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "right_outer_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-3.1669e-14, -0.021559, 0.015181) + float3 physics:diagonalInertia = (0.000019111, 0.0000019016687, 0.000017908931) + float physics:mass = 0.033618 + quatf physics:principalAxes = (0.95905584, 0.28321707, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "right_finger" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (2.5618e-14, 0.016413, 0.029258) + float3 physics:diagonalInertia = (0.000017493, 0.000018803807, 0.0000035677933) + float physics:mass = 0.048304 + quatf physics:principalAxes = (0.98660326, 0.16313848, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" + { + rel physics:body0 = + rel physics:body1 = + point3f physics:localPos0 = (-1.4901161e-8, -5.543226e-7, -8.1960415e-8) + quatf physics:localRot0 = (1, 0.0000036358833, 0, 0) + } + } + + over "joints" + { + def PhysicsRevoluteJoint "joint1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.029319312 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 73.29828 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.11727725 + point3f physics:localPos0 = (0, 0, 0.267) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.045730196 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 114.325485 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.18292078 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -117.97201 + float physics:upperLimit = 120.00027 + } + + def PhysicsRevoluteJoint "joint3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.03811218 + float drive:angular:physics:maxForce = 32 + float drive:angular:physics:stiffness = 95.28044 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.15244871 + point3f physics:localPos0 = (0.0535, -0.2845, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -225.00052 + float physics:upperLimit = 10.999643 + } + + def PhysicsRevoluteJoint "joint4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.113224 + float drive:angular:physics:maxForce = 32 + float drive:angular:physics:stiffness = 283.06 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.452896 + point3f physics:localPos0 = (0.0775, 0.3425, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0039054018 + float drive:angular:physics:maxForce = 32 + float drive:angular:physics:stiffness = 9.763505 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.015621607 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -97.00003 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "joint6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0008312844 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2.0782108 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0033251375 + point3f physics:localPos0 = (0.076, 0.097, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "world" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, 0, 0.09103) + float3 physics:diagonalInertia = (0.0049502417, 0.004940307, 0.0022189417) + float physics:mass = 2.7 + quatf physics:principalAxes = (0.9810616, 0.0007472661, -0.002186588, -0.19368237) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link_base" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00022, 0.02951, -0.0124) + float3 physics:diagonalInertia = (0.0058569694, 0.0054443358, 0.0031231462) + float physics:mass = 2.3814 + quatf physics:principalAxes = (0.9761389, -0.21607858, -0.0038730428, -0.021167317) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link1" + { + over "mesh_14" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link2" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.03881, -0.22783, 0.03496) + float3 physics:diagonalInertia = (0.029447667, 0.0038344867, 0.028178321) + float physics:mass = 2.2675 + quatf physics:principalAxes = (0.9816962, 0.08323946, 0.12834497, 0.113451876) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link2" + { + over "mesh_15" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link3" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.07041, 0.11631, 0.0107) + float3 physics:diagonalInertia = (0.007141316, 0.001967532, 0.0069947117) + float physics:mass = 1.875 + quatf physics:principalAxes = (0.89899915, -0.2971964, -0.300907, -0.11371001) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link3" + { + over "mesh_16" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link4" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00018, 0.01798, -0.02291) + float3 physics:diagonalInertia = (0.0048961407, 0.0044740294, 0.0013260889) + float physics:mass = 1.3192 + quatf physics:principalAxes = (0.99929017, -0.036970165, 0.0017942905, -0.0070117405) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link4" + { + over "mesh_17" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link5" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0651, 0.03096, 0.00315) + float3 physics:diagonalInertia = (0.001087311, 0.0021336714, 0.0024182417) + float physics:mass = 1.33854 + quatf physics:principalAxes = (0.9513926, 0.044362426, 0.13940279, 0.27101883) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link5" + { + over "mesh_18" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link6" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, -0.00677, -0.01098) + float3 physics:diagonalInertia = (0.000093, 0.000058523616, 0.00013217637) + float physics:mass = 0.17 + quatf physics:principalAxes = (0.9997004, 0.024475647, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "end_tool" + { + over "mesh_20" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} diff --git a/ufactory_xarm6/payloads/Physics/physx.usda b/ufactory_xarm6/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..a463974f874258dab14eed2d199c19a710d755f8 --- /dev/null +++ b/ufactory_xarm6/payloads/Physics/physx.usda @@ -0,0 +1,407 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 114.59155 + } + + over "left_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "right_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + } + + over "xarm_gripper_base_link" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "left_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "right_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:articulationEnabled = 0 + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_14" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_15" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_16" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_17" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_18" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "end_tool" + { + over "mesh_20" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/ufactory_xarm6/payloads/Sensor/none.usda b/ufactory_xarm6/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_xarm6/payloads/Sensor/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm6/payloads/Sensor/sensors.usda b/ufactory_xarm6/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..bec5a0cb02e1d3d0710abfcb18049342e3c573be --- /dev/null +++ b/ufactory_xarm6/payloads/Sensor/sensors.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper.usd b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper.usd new file mode 100644 index 0000000000000000000000000000000000000000..933669a241cde9df955f2963050de2b1bb6a96ad Binary files /dev/null and b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper.usd differ diff --git a/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_base.usd b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_base.usd new file mode 100644 index 0000000000000000000000000000000000000000..c28f99c5cec74704bb9919fa6eb95664e62dacff --- /dev/null +++ b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_base.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f356bf48592b1fd465d130b588b69d70a5dc5d7c1b7029807ecd9121d243eed +size 5877373 diff --git a/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_physics.usd b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_physics.usd new file mode 100644 index 0000000000000000000000000000000000000000..99d2b234fd313aa3930b608b139e13a0aa6a07ae Binary files /dev/null and b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_physics.usd differ diff --git a/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd new file mode 100644 index 0000000000000000000000000000000000000000..7bfb6ce8374e2b1f6b45f3bc70175cb6898af8a0 Binary files /dev/null and b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd differ diff --git a/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd new file mode 100644 index 0000000000000000000000000000000000000000..03b5d0ef4d25265a2b5ad0e84760b55a1699cfe8 Binary files /dev/null and b/ufactory_xarm6/payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd differ diff --git a/ufactory_xarm6/payloads/Variant_Set/none.usda b/ufactory_xarm6/payloads/Variant_Set/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_xarm6/payloads/Variant_Set/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm6/payloads/Variant_Set/xarm_gripper.usda b/ufactory_xarm6/payloads/Variant_Set/xarm_gripper.usda new file mode 100644 index 0000000000000000000000000000000000000000..91f45208f9d94816de1eecc30fc79fcf14880f64 --- /dev/null +++ b/ufactory_xarm6/payloads/Variant_Set/xarm_gripper.usda @@ -0,0 +1,29 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" ( + customData = { + string[] variantPrimPaths = ["gripper/root_joint", "gripper"] + } +) +{ + over "gripper" ( + prepend payload = @./dependencies/xarm_gripper.usd@ + ) + { + over "root_joint" + { + custom rel physics:body0 + prepend rel physics:body0 = + } + } +} + diff --git a/ufactory_xarm6/payloads/base.usda b/ufactory_xarm6/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..f294f451be02e3e77d2f1e669aebc02b4497a6b9 --- /dev/null +++ b/ufactory_xarm6/payloads/base.usda @@ -0,0 +1,753 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + customData = { + string[] variantPrimPaths = ["gripper/root_joint", "gripper"] + } +) +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "gripper" + { + quatd xformOp:orient = (6.123233995736766e-17, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.207, 0, 0.112) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + } + + def Scope "joints" + { + } + + def Xform "xarm_gripper_base_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_tcp" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.1720000058412552) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "base_link" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "base_link" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "left_outer_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.03500000014901161, 0.059098001569509506) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "left_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "left_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "left_finger" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.07046499848365784, 0.10113699734210968) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "left_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "left_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_4" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "left_inner_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.019999999552965164, 0.07409799844026566) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "left_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "left_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_6" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "right_inner_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.019999999552965164, 0.07409799844026566) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "right_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "right_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_8" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "right_outer_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.03500000014901161, 0.059098001569509506) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "right_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "right_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "right_finger" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.07046499848365784, 0.10113699734210968) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "right_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "right_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_12" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + } + + def Scope "Looks" + { + def Material "material_Silver" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.753, 0.753, 0.753) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_White" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + + def Scope "joints" + { + } + + def Xform "world" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_base" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link_base" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link_base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link1" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.2669999897480011) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_14" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link2" + { + quatd xformOp:orient = (0.7071055173873901, -0.7071080803871155, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.2669999897480011) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link2" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_15" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link3" + { + quatd xformOp:orient = (0.7071055173873901, -0.7071080803871155, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05350000783801079, 0.000001017451268126024, 0.5514999628067017) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link3" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_16" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link4" + { + quatd xformOp:orient = (-0.000003635883331298828, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.13100001215934753, -2.0742413653351832e-7, 0.20899993181228638) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link4" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_17" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link5" + { + quatd xformOp:orient = (0.7071055173873901, -0.7071080803871155, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.13100001215934753, -2.0742413653351832e-7, 0.20899993181228638) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link5" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_18" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link6" + { + quatd xformOp:orient = (-0.000003635883331298828, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.2070000171661377, -5.543231509363977e-7, 0.11199992150068283) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_eef" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link6" ( + prepend apiSchemas = ["MaterialBindingAPI"] + instanceable = true + prepend references = @./instances.usda@ + ) + { + rel material:binding = ( + bindMaterialAs = "strongerThanDescendants" + ) + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "end_tool" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_20" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/ufactory_xarm6/payloads/geometries.usd b/ufactory_xarm6/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..d16e4db5e9ab9e8ad5eceb375323d6f7a9be446c --- /dev/null +++ b/ufactory_xarm6/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1896ea38c3745d75b87b5220eb16a9ea4647044fac8e3d7e7b61cfc5d1367b2 +size 9596098 diff --git a/ufactory_xarm6/payloads/instances.usda b/ufactory_xarm6/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..01b1f3f947bf45da4c059dbc677456759228657e --- /dev/null +++ b/ufactory_xarm6/payloads/instances.usda @@ -0,0 +1,1175 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_13_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_14" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_14" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_14_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_14" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_15" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_15" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_15_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_15" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_16" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_16" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_16_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_16" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_17" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_17" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_17_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_17" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_18" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_18" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_18_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_18" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_19" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_19" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_20" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_20" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/ufactory_xarm6/payloads/materials.usda b/ufactory_xarm6/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..1042080fa2140bb4dc1c9408bc6ec536a4ae8f34 --- /dev/null +++ b/ufactory_xarm6/payloads/materials.usda @@ -0,0 +1,563 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "DefaultMaterial" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "j____________" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "j____________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Black" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Red" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.8, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Silver" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "none" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.753, 0.753, 0.753) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.753, 0.753, 0.753) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_White" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/ufactory_xarm6/payloads/robot.usda b/ufactory_xarm6/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..a9ba638ee343f1cd0d6a072a3f2756062854dee7 --- /dev/null +++ b/ufactory_xarm6/payloads/robot.usda @@ -0,0 +1,516 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string[] isaac:changelog ( + displayName = "Changelog" + ) + string isaac:description ( + displayName = "Description" + ) + token isaac:license ( + displayName = "License" + ) + string isaac:namespace ( + displayName = "Namespace" + doc = "Namespace of the prim in Isaac Sim" + ) + rel isaac:physics:robotJoints ( + displayName = "Robot Joints" + ) + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + , + , + ] + rel isaac:physics:robotLinks ( + displayName = "Robot Links" + ) + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" ( + displayName = "Robot Type" + ) + string isaac:source ( + displayName = "Source" + ) + string isaac:version ( + displayName = "Version" + ) + + over "gripper" ( + prepend apiSchemas = ["IsaacRobotAPI"] + ) + { + string[] isaac:changelog ( + displayName = "Changelog" + ) + string isaac:description ( + displayName = "Description" + ) + token isaac:license ( + displayName = "License" + ) + string isaac:namespace ( + displayName = "Namespace" + doc = "Namespace of the prim in Isaac Sim" + ) + rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + ] ( + displayName = "Robot Joints" + ) + rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] ( + displayName = "Robot Links" + ) + token isaac:robotType ( + displayName = "Robot Type" + ) + string isaac:source ( + displayName = "Source" + ) + string isaac:version ( + displayName = "Version" + ) + + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "left_finger_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "right_finger_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "xarm_gripper_base_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + + over "link_tcp" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "left_outer_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "left_finger" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "left_inner_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "right_inner_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "right_outer_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "right_finger" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + bool[] isaac:actuator ( + displayName = "Actuator" + ) + string isaac:NameOverride ( + displayName = "Joint Name Override" + ) + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + token[] isaac:physics:DofOffsetOpOrder ( + displayName = "Dof Offset Op Order" + ) + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint2" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + bool[] isaac:actuator ( + displayName = "Actuator" + ) + string isaac:NameOverride ( + displayName = "Joint Name Override" + ) + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + token[] isaac:physics:DofOffsetOpOrder ( + displayName = "Dof Offset Op Order" + ) + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint3" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint4" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint5" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint6" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "world" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + + over "link_base" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "link1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + } + + over "link2" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + } + + over "link3" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + } + + over "link4" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + } + + over "link5" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + } + + over "link6" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + + over "link_eef" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } +} diff --git a/ufactory_xarm6/runnables/physics/mujoco.usda b/ufactory_xarm6/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..f28e3107bad93e65557966730aa3fe496d59aa14 --- /dev/null +++ b/ufactory_xarm6/runnables/physics/mujoco.usda @@ -0,0 +1,421 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +def "UF_ROBOT" +{ + over "gripper" + { + over "xarm_gripper_base_link" + { + over "collisions" + { + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" + { + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_finger" + { + over "collisions" + { + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" + { + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" + { + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" + { + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_finger" + { + over "collisions" + { + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "left_finger_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "right_finger_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + } + + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_14" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_15" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_16" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_17" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_18" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "end_tool" + { + over "mesh_20" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_UF_ROBOT_gripper_joints_drive_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -31.24843988679391, -0.012499376248202255] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 1000 + double mjc:forceRange:min = -1000 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint1" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -4199.682021305622, -1.6798728600901771] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 50 + double mjc:forceRange:min = -50 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint2" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -6550.367794435134, -2.6201472236419856] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 50 + double mjc:forceRange:min = -50 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint3" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -5459.167155727546, -2.183666972940083] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 32 + double mjc:forceRange:min = -32 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint4" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -16218.143209090807, -6.487257324617458] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 32 + double mjc:forceRange:min = -32 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint5" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -559.407628723245, -0.22376304032620759] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 32 + double mjc:forceRange:min = -32 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint6" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -119.07270953682661, -0.04762908687230751] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 20 + double mjc:forceRange:min = -20 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } +} + diff --git a/ufactory_xarm6/runnables/physics/newton.usda b/ufactory_xarm6/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..412d3951475e895271d659f9c8efbd6e0f09fe7a --- /dev/null +++ b/ufactory_xarm6/runnables/physics/newton.usda @@ -0,0 +1,370 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "xarm_gripper_base_link" + { + over "collisions" + { + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" + { + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_finger" + { + over "collisions" + { + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" + { + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" + { + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" + { + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_finger" + { + over "collisions" + { + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 3.2725 + float newton:damping = 0.109083 + float newton:velocityLimit = 114.59155 + } + + over "left_finger_joint" ( + prepend apiSchemas = ["NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "right_finger_joint" ( + prepend apiSchemas = ["NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + } + } + + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_13" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_14" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_15" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_16" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_17" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_18" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "end_tool" + { + over "mesh_20" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 10.4219 + float newton:damping = 0.347398 + float newton:velocityLimit = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 45 + float newton:damping = 0.347398 + float newton:velocityLimit = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 100 + float drive:angular:physics:stiffness = 60 + float newton:damping = 0.625873 + float newton:velocityLimit = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 6.67 + float newton:damping = 0.222335 + float newton:velocityLimit = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 6.67 + float newton:damping = 0.222335 + float newton:velocityLimit = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.1688 + float newton:damping = 0.138959 + float newton:velocityLimit = 179.90874 + } + } +} + diff --git a/ufactory_xarm6/runnables/physics/physx.usda b/ufactory_xarm6/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..7558bd8ec22233274a1d475fd4651d2c4c1ef1f9 --- /dev/null +++ b/ufactory_xarm6/runnables/physics/physx.usda @@ -0,0 +1,428 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 114.59155 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "left_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "xarm_gripper_base_link" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "base_link" + { + over "mesh" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_outer_knuckle" + { + over "mesh_2" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_finger" + { + over "mesh_4" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_inner_knuckle" + { + over "mesh_6" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_inner_knuckle" + { + over "mesh_8" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_outer_knuckle" + { + over "mesh_10" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_finger" + { + over "mesh_12" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:articulationEnabled = 0 + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_13" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_14" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_15" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_16" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_17" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_18" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "end_tool" + { + over "mesh_20" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/ufactory_xarm6/xarm6.usda b/ufactory_xarm6/xarm6.usda new file mode 100644 index 0000000000000000000000000000000000000000..5f731e4d470fc6fb7baf81816d1a32a8d442fff4 --- /dev/null +++ b/ufactory_xarm6/xarm6.usda @@ -0,0 +1,575 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + string "optional requirements" = "['com.nvidia.simready.MUJOCO.DJ.002']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.33678496, 0.20547232, 0.64452136) + string asset_license = "Unknown - not verified; no permissions asserted" + string asset_name = "xarm6" + string asset_type = "robot" + string author = "Ufactory" + string category = "robotic arm" + string distribution_policy = "Internal handling policy: exclude from redistribution until applicable rights are verified. This policy grants no license or viewing permission." + string license_status = "unverified" + double mass = 12.803069647401571 + string qcode = "Q40687" + int rigid_body_count = 14 + string source_file = "Ufactory/xarm6/xarm6.usda" + string usage_clearance = "Pending source-license or rights-holder verification" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + string Variant_Set = "none" + } + variantSets = ["Variant_Set", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "gripper" + { + over "xarm_gripper_base_link" + { + over "collisions" + { + token visibility = "invisible" + + over "base_link" ( + instanceable = false + ) + { + over "mesh" + { + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" + { + over "left_outer_knuckle" ( + instanceable = false + ) + { + over "mesh_2" + { + token visibility = "invisible" + } + } + } + } + + over "left_finger" + { + over "collisions" + { + over "left_finger" ( + instanceable = false + ) + { + over "mesh_4" + { + token visibility = "invisible" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" + { + over "left_inner_knuckle" ( + instanceable = false + ) + { + over "mesh_6" + { + token visibility = "invisible" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" + { + over "right_inner_knuckle" ( + instanceable = false + ) + { + over "mesh_8" + { + token visibility = "invisible" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" + { + over "right_outer_knuckle" ( + instanceable = false + ) + { + over "mesh_10" + { + token visibility = "invisible" + } + } + } + } + + over "right_finger" + { + over "collisions" + { + over "right_finger" ( + instanceable = false + ) + { + over "mesh_12" + { + token visibility = "invisible" + } + } + } + } + } + + over "world" + { + over "collisions" + { + token visibility = "invisible" + + over "link_base" ( + instanceable = false + ) + { + over "mesh_13" + { + } + } + } + } + + over "link1" + { + over "collisions" + { + token visibility = "invisible" + + over "link1" ( + instanceable = false + ) + { + over "mesh_14" + { + } + } + } + } + + over "link2" + { + over "collisions" + { + token visibility = "invisible" + + over "link2" ( + instanceable = false + ) + { + over "mesh_15" + { + } + } + } + } + + over "link3" + { + over "collisions" + { + token visibility = "invisible" + + over "link3" ( + instanceable = false + ) + { + over "mesh_16" + { + } + } + } + } + + over "link4" + { + over "collisions" + { + token visibility = "invisible" + + over "link4" ( + instanceable = false + ) + { + over "mesh_17" + { + } + } + } + } + + over "link5" + { + over "collisions" + { + token visibility = "invisible" + + over "link5" ( + instanceable = false + ) + { + over "mesh_18" + { + } + } + } + } + + over "link6" + { + over "collisions" + { + over "end_tool" ( + instanceable = false + ) + { + over "mesh_20" + { + token visibility = "invisible" + } + } + } + } + variantSet "Variant_Set" = { + "none" ( + prepend payload = @./payloads/Variant_Set/none.usda@ + ) { + + } + "xarm_gripper" ( + prepend payload = @./payloads/Variant_Set/xarm_gripper.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/ufactory_xarm7/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/ufactory_xarm7/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..20f3b17b5499f3875175084dfeda7ac680203728 --- /dev/null +++ b/ufactory_xarm7/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:31", + "assets": [ + { + "asset": "xarm7.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/ufactory_xarm7/.metadata/com.nvidia.simready.packaging.bom.json b/ufactory_xarm7/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..40a12be84e3064ae332bf402a4413130bf111300 --- /dev/null +++ b/ufactory_xarm7/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,271 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7624, + "hash": { + "sha256-flat-1mb": "a7577552d107bba3e2e88d4ac9ab06b285605519e0862fae0b43938aa7c0c137", + "sha256": "a6b7af64162fcc6026569f04d9a8f12e4ed432f6656a6941803c8a52a87b74ed" + } + }, + { + "relative_path": ".thumbs/256x256/.xarm7.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "1746c4e6d627a2e09b8ab7485d36cc51f2a8e544bc98391d784c8cd865ef50f0", + "sha256": "994e3d9475e466ce890d8b3846f4fe9e77cab57e627e97123b55274649ae1822" + } + }, + { + "relative_path": ".thumbs/256x256/xarm7.usda.png", + "size": 41103, + "hash": { + "sha256-flat-1mb": "9fc82d6dd218a2cf094b674a4cad88731b47cdf0511d7e8533410056ace164b4", + "sha256": "61dafbe26f4affb9e4344e8dce68c96eddaf091a02fdb2b9a1075a1ab22c2fc6" + } + }, + { + "relative_path": ".thumbs/xarm7.thumb.usd", + "size": 6122, + "hash": { + "sha256-flat-1mb": "117d5b8204a6405c7d28daf87fc054a053718030bfcdf6cc6327c000a2df2c50", + "sha256": "b6ba6dd0b534b59373c0e538eec7ea38efe4ff9beffd662fb7575aac8201896b" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 8029, + "hash": { + "sha256-flat-1mb": "3f86b5f5fc58dc59f49b896c715bbc318a030313d7facd89310f2ffa7ae5948b", + "sha256": "9673cf485aae612cbdb12a88d32baa8e3ac79d0383d48c5c6b57cc2d0acfeb4e" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 25823, + "hash": { + "sha256-flat-1mb": "b76248a1d9987d025baaf3bf966af966e94d35611110873ac6a56b074f616923", + "sha256": "858c7922dddefeab73c2af9399033a95070947e760e4e247898e576ffd41aa6b" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 11687, + "hash": { + "sha256-flat-1mb": "6de18eba4034ba9b678d7096e31138af17cbd9e373a45c58775c8397f15ca5ce", + "sha256": "f4a4ce19ba1d21f74f654d9267e21fb6cd4b224c58a9d768708238392d7a4ad5" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 182, + "hash": { + "sha256-flat-1mb": "d392f6a450ccc3b70ee9435af34b22ec27a86f2e05875882cfc9f5636f214baf", + "sha256": "9fdf02f90c92f16455e316ef9f4caa71de16a9cdbb9b990dae4640c495678bf6" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper.usd", + "size": 2289, + "hash": { + "sha256-flat-1mb": "8a2230eac8ee0a8bec7d17f6a8ec38f50ad5bd4d4e696be391bd135ffdb54833", + "sha256": "2f2cf0cc6e5c095066da479f1db5bc499186d2f581dc99645a2f5679a1cb13c8" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_base.usd", + "size": 5877373, + "hash": { + "sha256-flat-1mb": "2548aec1471528c51078cc810cc8b2b72df3b636cfba04047db8132cd6a73b1a", + "sha256": "1f356bf48592b1fd465d130b588b69d70a5dc5d7c1b7029807ecd9121d243eed", + "sha256-first1m": "c53768699cf9a585fe58518fc7ed99d1a74345748dd69e8bb180962c99e502bc" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_physics.usd", + "size": 6510, + "hash": { + "sha256-flat-1mb": "f806a943203bd8fc17f04fc627976466f8e8df71ede70c3a2a315c9d044094c9", + "sha256": "6cc389826462267371010b03c1f9e606127dbb8c9183aa74bc1d4a9e95afb634" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd", + "size": 2416, + "hash": { + "sha256-flat-1mb": "8d082eeb2edf321f21ddd3e0f9d157ddf3116bd6499bfa2703112c0b5244b33e", + "sha256": "37d54fb0b752a7e47340f158a8e405c8249203e55e74303d97ffb0a22344102e" + } + }, + { + "relative_path": "payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd", + "size": 690, + "hash": { + "sha256-flat-1mb": "e74238be5d99647cf96bac153e5d855551dd9f994aa9befc9248f611632642bc", + "sha256": "4bed23ef0103ae6cbd63ab013eea59912f48a9c0728203ce2fecac3e56bff233" + } + }, + { + "relative_path": "payloads/Variant_Set/none.usda", + "size": 176, + "hash": { + "sha256-flat-1mb": "83a4f1ac5b3876927e8d66375f9771586b9e9e9c245a524ac01a71dee250abc9", + "sha256": "cd9a532729c93c378175a9d858faff41f567386df85835fd1b09e7317e7b4b17" + } + }, + { + "relative_path": "payloads/Variant_Set/xarm_gripper.usda", + "size": 515, + "hash": { + "sha256-flat-1mb": "f0750513d0ca46380dee31e402cd8aab4a338156db19f01d647a25dba55f88c3", + "sha256": "b275f358165f92800322cf4d48525ab8ada67808afb43a73ff1d06a8b6c0dddb" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 24696, + "hash": { + "sha256-flat-1mb": "e6474a5c5a059afeaf59e10617bdae27bf157fff8bb5a5c56f437ca02d6ae1c2", + "sha256": "68ac578b95ca3c30dae741ff913b4083b06803f76da98ba3c688af6cad343d86" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 12193746, + "hash": { + "sha256-flat-1mb": "6ecacf9c18b82d6b7d94c9fafd777c47060e604dbbd83c6b3b4ccd54d2cdebdf", + "sha256": "2c98ef6e05ee1693659f5de512abb9f9efd3140e3600d7d8cfe3a46259215093", + "sha256-first1m": "b525635bb7faa4f7937fd805d9e764b18590450d1499d97f32662302f805dd3d" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 52077, + "hash": { + "sha256-flat-1mb": "e542cd75d9c5c033c111692572fed03737bab957f097112f924ce7012c782a09", + "sha256": "90b542b90d2aad86b09d3eb0eef2c406b80e5dba5f787cd80b20832005487a56" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 31513, + "hash": { + "sha256-flat-1mb": "fa7243c0555e4e263bba52367669d2faa51446be4dcec8da83007c2a07026802", + "sha256": "058b55a79f3215fbe9cee3d5d2834b2f6d9842779b997e7964a1883da03b9e0e" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 14129, + "hash": { + "sha256-flat-1mb": "c2a89785b14a79f120776472930030277ae9a7c972967327b193d8ba846f4caa", + "sha256": "04acd71682dc4f6bd47d8a2e7a07b8ddca7d1e703bd3cf77dae479df0f6df9f6" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 14573, + "hash": { + "sha256-flat-1mb": "8e3fe868c28df3c60fb93bc83fa763fca069dc72bf466fb74d2238a482b351ba", + "sha256": "74fb4c55d09c1a6bf0448c55159e87a5cf88dea3e0c5c29d41d3908cc023c127" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 11469, + "hash": { + "sha256-flat-1mb": "4b91ec36bfea24652bfcf0d8197e97161afe6fe92fbd00b4b3c1f8357264e626", + "sha256": "82e15ca4d3bd9f3cf5c1dbf47354dc7dd474185dde8146be234b86eaf9a32046" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 13798, + "hash": { + "sha256-flat-1mb": "e84c26e0d8a8aca137b0301b8cca662ffd95b3d301fc5416275ed07ae33e59d3", + "sha256": "6bf72341d52f7ff1c4b33d3a5d76f8a5d15828be62146f9628de75b0a0d07ad0" + } + }, + { + "relative_path": "xarm7.usda", + "size": 20184, + "hash": { + "sha256-flat-1mb": "55270cd4d78111af18fd148281ea64f6bcfbf29556246126f30079fde5792922", + "sha256": "b542f54662765fc7b6aed5aae9f24463f81ccbc15fdd7b4e7774433f245b6d6a" + } + } + ] +} \ No newline at end of file diff --git a/ufactory_xarm7/.metadata/com.nvidia.simready.root_usds.json b/ufactory_xarm7/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..a3757c06c1e8236932424ac25e6a125a5f63d55e --- /dev/null +++ b/ufactory_xarm7/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "xarm7.usda" + ] +} diff --git a/ufactory_xarm7/.simready/validation.json b/ufactory_xarm7/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..fa9d519c7115ed3d699ca78e5a7960d0f7409003 --- /dev/null +++ b/ufactory_xarm7/.simready/validation.json @@ -0,0 +1,224 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "optional requirements": "['com.nvidia.simready.MUJOCO.DJ.002']", + "passed": false, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/ufactory_xarm7/.thumbs/256x256/.xarm7.usda.last_generated b/ufactory_xarm7/.thumbs/256x256/.xarm7.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..79695c21c75a5734f9d85f4e0b34cc25f9ed3aba --- /dev/null +++ b/ufactory_xarm7/.thumbs/256x256/.xarm7.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:43:56 \ No newline at end of file diff --git a/ufactory_xarm7/.thumbs/256x256/xarm7.usda.png b/ufactory_xarm7/.thumbs/256x256/xarm7.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc129429abf62b3f56776060491e3b8c0498754 --- /dev/null +++ b/ufactory_xarm7/.thumbs/256x256/xarm7.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61dafbe26f4affb9e4344e8dce68c96eddaf091a02fdb2b9a1075a1ab22c2fc6 +size 41103 diff --git a/ufactory_xarm7/.thumbs/xarm7.thumb.usd b/ufactory_xarm7/.thumbs/xarm7.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..d2a74ee75229602e74d597818d6b039f8e141373 Binary files /dev/null and b/ufactory_xarm7/.thumbs/xarm7.thumb.usd differ diff --git a/ufactory_xarm7/com.nvidia.simready.packaging.json b/ufactory_xarm7/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..f794c7d5657e35e18c2177eedded30508021e665 --- /dev/null +++ b/ufactory_xarm7/com.nvidia.simready.packaging.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.0", + "package_id": "ufactory_xarm7.1.0.0", + "license": "unknown", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "692501142096df716b27355bd8bb37ef12d2e17698395cce8d5ed9113e21de15" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "994468df5db00b9c375592be9146d901a1e7b5b9e6f852de3a247da3a6ddbe3a" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "4f26379eca284785467a19b50d32e506982bcafa645d701b74ec40838848d1c9" + } + } + ], + "content_hash": { + "sha256": "d7bd260c0abd593f54d1490689341c042adf6ef77974324a8ffd8369930588a8" + }, + "package_hash": { + "sha256": "68431a3ae4f4a7994efbda8c87468db4245ad6d63c4230ad90c81029aaca3a0c" + } +} \ No newline at end of file diff --git a/ufactory_xarm7/materials/mdl/LICENSE.md b/ufactory_xarm7/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/ufactory_xarm7/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/ufactory_xarm7/materials/mdl/OmniPBR.mdl b/ufactory_xarm7/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/ufactory_xarm7/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_xarm7/materials/mdl/OmniPBRBase.mdl b/ufactory_xarm7/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/ufactory_xarm7/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/ufactory_xarm7/materials/mdl/OmniPBR_ClearCoat.mdl b/ufactory_xarm7/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/ufactory_xarm7/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/ufactory_xarm7/materials/mdl/aux_definitions.mdl b/ufactory_xarm7/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/ufactory_xarm7/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/ufactory_xarm7/materials/mdl/core_definitions.mdl b/ufactory_xarm7/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/ufactory_xarm7/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/ufactory_xarm7/materials/mdl/support_definitions.mdl b/ufactory_xarm7/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/ufactory_xarm7/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/ufactory_xarm7/payloads/Physics/mujoco.usda b/ufactory_xarm7/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..8dae8722d55f614899585c4bcdbda05e2c5241c3 --- /dev/null +++ b/ufactory_xarm7/payloads/Physics/mujoco.usda @@ -0,0 +1,447 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + over "drive_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "left_finger_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "left_inner_knuckle_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "right_inner_knuckle_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "right_outer_knuckle_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + + over "right_finger_joint" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "xarm_gripper_base_link" + { + over "link_tcp" + { + } + + over "visuals" + { + over "base_link" + { + } + } + + over "collisions" + { + over "base_link" + { + over "mesh" ( + ) + { + } + } + } + } + + over "left_outer_knuckle" + { + over "visuals" + { + over "left_outer_knuckle" + { + } + } + + over "collisions" + { + over "left_outer_knuckle" + { + over "mesh_2" ( + ) + { + } + } + } + } + + over "left_finger" + { + over "visuals" + { + over "left_finger" + { + } + } + + over "collisions" + { + over "left_finger" + { + over "mesh_4" ( + ) + { + } + } + } + } + + over "left_inner_knuckle" + { + over "visuals" + { + over "left_inner_knuckle" + { + } + } + + over "collisions" + { + over "left_inner_knuckle" + { + over "mesh_6" ( + ) + { + } + } + } + } + + over "right_inner_knuckle" + { + over "visuals" + { + over "right_inner_knuckle" + { + } + } + + over "collisions" + { + over "right_inner_knuckle" + { + over "mesh_8" ( + ) + { + } + } + } + } + + over "right_outer_knuckle" + { + over "visuals" + { + over "right_outer_knuckle" + { + } + } + + over "collisions" + { + over "right_outer_knuckle" + { + over "mesh_10" ( + ) + { + } + } + } + } + + over "right_finger" + { + over "visuals" + { + over "right_finger" + { + } + } + + over "collisions" + { + over "right_finger" + { + over "mesh_12" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + } + + over "joints" + { + over "joint1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "joint7" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "world" + { + over "link_base" + { + } + + over "visuals" + { + over "link_base" + { + } + } + + over "collisions" + { + over "link_base" + { + over "mesh_14" ( + ) + { + } + } + } + } + + over "link1" + { + over "visuals" + { + over "link1" + { + } + } + + over "collisions" + { + over "link1" + { + over "mesh_16" ( + ) + { + } + } + } + } + + over "link2" + { + over "visuals" + { + over "link2" + { + } + } + + over "collisions" + { + over "link2" + { + over "mesh_18" ( + ) + { + } + } + } + } + + over "link3" + { + over "visuals" + { + over "link3" + { + } + } + + over "collisions" + { + over "link3" + { + over "mesh_20" ( + ) + { + } + } + } + } + + over "link4" + { + over "visuals" + { + over "link4" + { + } + } + + over "collisions" + { + over "link4" + { + over "mesh_22" ( + ) + { + } + } + } + } + + over "link5" + { + over "visuals" + { + over "link5" + { + } + } + + over "collisions" + { + over "link5" + { + over "mesh_24" ( + ) + { + } + } + } + } + + over "link6" + { + over "visuals" + { + over "link6" + { + } + } + + over "collisions" + { + over "link6" + { + over "mesh_26" ( + ) + { + } + } + } + } + + over "link7" + { + over "link_eef" + { + } + + over "visuals" + { + over "link7" + { + } + } + + over "collisions" + { + over "end_tool" + { + over "mesh_28" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/ufactory_xarm7/payloads/Physics/none.usda b/ufactory_xarm7/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_xarm7/payloads/Physics/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm7/payloads/Physics/physics.usda b/ufactory_xarm7/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..6540b7c6bfc7c8942b9528f82aba0c245ac6cb95 --- /dev/null +++ b/ufactory_xarm7/payloads/Physics/physics.usda @@ -0,0 +1,696 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + def PhysicsRevoluteJoint "drive_joint" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.00021815527 + float drive:angular:physics:maxForce = 1000 + float drive:angular:physics:stiffness = 0.54538816 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0008726211 + point3f physics:localPos0 = (0, 0.035, 0.059098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = 0 + float physics:upperLimit = 48.701412 + } + + def PhysicsRevoluteJoint "left_finger_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00037557803 + point3f physics:localPos0 = (0, 0.035465, 0.042039) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "left_inner_knuckle_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00030888498 + point3f physics:localPos0 = (0, 0.02, 0.074098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "right_inner_knuckle_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0003042112 + point3f physics:localPos0 = (0, -0.02, 0.074098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "right_outer_knuckle_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00081987266 + point3f physics:localPos0 = (0, -0.035, 0.059098) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + + def PhysicsRevoluteJoint "right_finger_joint" ( + ) + { + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.00037432538 + point3f physics:localPos0 = (0, -0.035465, 0.042039) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -9.740283 + float physics:upperLimit = 58.441696 + } + } + + over "xarm_gripper_base_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00065489, -0.0018497001, 0.048028) + float3 physics:diagonalInertia = (0.0004710948, 0.00033230297, 0.0002548022) + float physics:mass = 0.54156 + quatf physics:principalAxes = (0.99740654, 0.07167488, 0.006125353, -0.0023352539) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "left_outer_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (2.9948e-14, 0.021559, 0.015181) + float3 physics:diagonalInertia = (0.000019111, 0.0000019016687, 0.000017908931) + float physics:mass = 0.033618 + quatf physics:principalAxes = (0.95905584, -0.28321707, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "left_finger" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-2.4536e-14, -0.016413, 0.029258) + float3 physics:diagonalInertia = (0.000017493, 0.000018803687, 0.0000035679147) + float physics:mass = 0.048304 + quatf physics:principalAxes = (0.98660403, -0.16313326, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "left_inner_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0000018660079, 0.022046784, 0.026133467) + float3 physics:diagonalInertia = (0.0000060949, 0.000008342161, 0.0000027560097) + float physics:mass = 0.023012578 + quatf physics:principalAxes = (0.9392398, 0.34326172, -0.000004853818, 0.000020194318) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "right_inner_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.000001866, -0.022047, 0.026133) + float3 physics:diagonalInertia = (0.0000060949, 0.00000834209, 0.0000027560104) + float physics:mass = 0.023013 + quatf physics:principalAxes = (0.93924576, -0.34324545, -0.0000048531947, -0.000020195002) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "right_outer_knuckle" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-3.1669e-14, -0.021559, 0.015181) + float3 physics:diagonalInertia = (0.000019111, 0.0000019016687, 0.000017908931) + float physics:mass = 0.033618 + quatf physics:principalAxes = (0.95905584, 0.28321707, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "right_finger" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (2.5618e-14, 0.016413, 0.029258) + float3 physics:diagonalInertia = (0.000017493, 0.000018803807, 0.0000035677933) + float physics:mass = 0.048304 + quatf physics:principalAxes = (0.98660326, 0.16313848, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" + { + rel physics:body0 = + rel physics:body1 = + point3f physics:localPos0 = (-2.9802322e-8, 0.0000033365484, -2.9826584e-8) + quatf physics:localRot0 = (1, -0.0000036358833, 0, 0) + } + } + + over "joints" + { + def PhysicsRevoluteJoint "joint1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.014831601 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 37.079002 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.059326403 + point3f physics:localPos0 = (0, 0, 0.267) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.022355223 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 55.888058 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.08942089 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -117.97201 + float physics:upperLimit = 120.00027 + } + + def PhysicsRevoluteJoint "joint3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.059490785 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 148.72696 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.23796314 + point3f physics:localPos0 = (0, -0.293, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.09242338 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 231.05846 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.36969352 + point3f physics:localPos0 = (0.0525, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -10.999643 + float physics:upperLimit = 225.00052 + } + + def PhysicsRevoluteJoint "joint5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.07301808 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 182.54521 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.29207233 + point3f physics:localPos0 = (0.0775, -0.3425, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + + def PhysicsRevoluteJoint "joint6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.004060389 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 10.150972 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.016241556 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, 0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -97.00003 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "joint7" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 0.0008283881 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2.0709703 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "Z" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + float physics:JointEquivalentInertia = 0.0033135524 + point3f physics:localPos0 = (0.076, 0.097, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.7071055, -0.7071081, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "world" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.021131, -0.0016302, 0.056487996) + float3 physics:diagonalInertia = (0.0033528246, 0.0038202282, 0.0016772469) + float physics:mass = 0.88556 + quatf physics:principalAxes = (0.973841, 0.069211826, 0.2161202, -0.011643797) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link_base" + { + over "mesh_14" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link1" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0002, 0.02905, -0.01233) + float3 physics:diagonalInertia = (0.0056912666, 0.005333836, 0.0029386505) + float physics:mass = 2.382 + quatf physics:principalAxes = (0.97895294, -0.20276871, -0.004416274, -0.022726912) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link1" + { + over "mesh_16" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link2" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00022, -0.12856, 0.01735) + float3 physics:diagonalInertia = (0.009598977, 0.0020131455, 0.009377167) + float physics:mass = 1.869 + quatf physics:principalAxes = (0.96648127, 0.2565738, -0.008924625, -0.0020899116) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link2" + { + over "mesh_18" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link3" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0466, -0.02463, -0.00768) + float3 physics:diagonalInertia = (0.0035172144, 0.0029408862, 0.00195868) + float physics:mass = 1.6383 + quatf physics:principalAxes = (0.9138187, 0.28977504, 0.2814806, -0.041645568) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link3" + { + over "mesh_20" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link4" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.07047, -0.11575, 0.012) + float3 physics:diagonalInertia = (0.0065713683, 0.0018676266, 0.0064794747) + float physics:mass = 1.7269 + quatf physics:principalAxes = (0.90094894, 0.30399808, -0.28910586, 0.110878825) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link4" + { + over "mesh_22" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link5" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00032, 0.01604, -0.026) + float3 physics:diagonalInertia = (0.005347292, 0.0049907565, 0.0013489022) + float physics:mass = 1.3203 + quatf physics:principalAxes = (0.99931127, -0.030445736, 0.00057706673, 0.021208148) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link5" + { + over "mesh_24" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link6" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.06469, 0.03278, 0.02141) + float3 physics:diagonalInertia = (0.0010727287, 0.0022164627, 0.0024542091) + float physics:mass = 1.325 + quatf physics:principalAxes = (0.95211107, 0.03895554, 0.14025421, 0.26887864) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "link6" + { + over "mesh_26" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "link7" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0, -0.00677, -0.01098) + float3 physics:diagonalInertia = (0.000093, 0.000058523616, 0.00013217637) + float physics:mass = 0.17 + quatf physics:principalAxes = (0.9997004, 0.024475647, 0, 0) + rel physics:simulationOwner + + over "collisions" ( + ) + { + rel physics:simulationOwner + + over "end_tool" + { + over "mesh_28" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} diff --git a/ufactory_xarm7/payloads/Physics/physx.usda b/ufactory_xarm7/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..84544177bba5f0f6db2f1b597e75195d0e398452 --- /dev/null +++ b/ufactory_xarm7/payloads/Physics/physx.usda @@ -0,0 +1,433 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 114.59155 + } + + over "left_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + + over "right_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX"] + ) + { + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + } + } + + over "xarm_gripper_base_link" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "left_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "right_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:articulationEnabled = 0 + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + + over "joint7" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.90874 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_14" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_16" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_18" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_20" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_22" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_24" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link6" + { + over "mesh_26" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "link7" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "end_tool" + { + over "mesh_28" ( + prepend apiSchemas = ["PhysxMeshMergeCollisionAPI"] + ) + { + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/ufactory_xarm7/payloads/Sensor/none.usda b/ufactory_xarm7/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_xarm7/payloads/Sensor/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm7/payloads/Sensor/sensors.usda b/ufactory_xarm7/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..bec5a0cb02e1d3d0710abfcb18049342e3c573be --- /dev/null +++ b/ufactory_xarm7/payloads/Sensor/sensors.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper.usd b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper.usd new file mode 100644 index 0000000000000000000000000000000000000000..933669a241cde9df955f2963050de2b1bb6a96ad Binary files /dev/null and b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper.usd differ diff --git a/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_base.usd b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_base.usd new file mode 100644 index 0000000000000000000000000000000000000000..c28f99c5cec74704bb9919fa6eb95664e62dacff --- /dev/null +++ b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_base.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f356bf48592b1fd465d130b588b69d70a5dc5d7c1b7029807ecd9121d243eed +size 5877373 diff --git a/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_physics.usd b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_physics.usd new file mode 100644 index 0000000000000000000000000000000000000000..99d2b234fd313aa3930b608b139e13a0aa6a07ae Binary files /dev/null and b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_physics.usd differ diff --git a/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd new file mode 100644 index 0000000000000000000000000000000000000000..7bfb6ce8374e2b1f6b45f3bc70175cb6898af8a0 Binary files /dev/null and b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_robot_schema.usd differ diff --git a/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd new file mode 100644 index 0000000000000000000000000000000000000000..03b5d0ef4d25265a2b5ad0e84760b55a1699cfe8 Binary files /dev/null and b/ufactory_xarm7/payloads/Variant_Set/dependencies/xarm_gripper_sensor.usd differ diff --git a/ufactory_xarm7/payloads/Variant_Set/none.usda b/ufactory_xarm7/payloads/Variant_Set/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..96ce306e88511e6f849a6b332ce4d4b2384d1b77 --- /dev/null +++ b/ufactory_xarm7/payloads/Variant_Set/none.usda @@ -0,0 +1,15 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" +{ +} + diff --git a/ufactory_xarm7/payloads/Variant_Set/xarm_gripper.usda b/ufactory_xarm7/payloads/Variant_Set/xarm_gripper.usda new file mode 100644 index 0000000000000000000000000000000000000000..0654c56553c8ab4ccef97d97c12c53fcf4872287 --- /dev/null +++ b/ufactory_xarm7/payloads/Variant_Set/xarm_gripper.usda @@ -0,0 +1,29 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def "UF_ROBOT" ( + customData = { + string[] variantPrimPaths = ["gripper/root_joint", "gripper"] + } +) +{ + over "gripper" ( + prepend payload = @./dependencies/xarm_gripper.usd@ + ) + { + over "root_joint" + { + custom rel physics:body0 + prepend rel physics:body0 = + } + } +} + diff --git a/ufactory_xarm7/payloads/base.usda b/ufactory_xarm7/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..1108c953cced81fc9478cd36e188668b0f122ba0 --- /dev/null +++ b/ufactory_xarm7/payloads/base.usda @@ -0,0 +1,749 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + customData = { + string[] variantPrimPaths = ["gripper/root_joint", "gripper"] + } +) +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "gripper" + { + quatd xformOp:orient = (6.123233995736766e-17, -1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.206, 0, 0.1205) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Scope "Looks" + { + } + + def Scope "joints" + { + } + + def Xform "xarm_gripper_base_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_tcp" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.1720000058412552) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "base_link" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "base_link" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "left_outer_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.03500000014901161, 0.059098001569509506) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "left_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "left_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "left_finger" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.07046499848365784, 0.10113699734210968) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "left_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "left_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_4" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "left_inner_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.019999999552965164, 0.07409799844026566) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "left_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "left_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_6" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "right_inner_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.019999999552965164, 0.07409799844026566) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "right_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "right_inner_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_8" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "right_outer_knuckle" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.03500000014901161, 0.059098001569509506) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "right_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "right_outer_knuckle" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_10" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "right_finger" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, -0.07046499848365784, 0.10113699734210968) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "right_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "right_finger" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_12" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + } + + def Scope "Looks" + { + } + + def Scope "joints" + { + } + + def Xform "world" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_base" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link_base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link_base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_14" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link1" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.2669999897480011) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_16" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link2" + { + quatd xformOp:orient = (0.7071055173873901, -0.7071080803871155, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.2669999897480011) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_18" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link3" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0.0000010478496506038937, 0.5600000023841858) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_20" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link4" + { + quatd xformOp:orient = (0.7071055173873901, 0.7071080803871155, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05249999836087227, 0.0000010478496506038937, 0.5600000023841858) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_22" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link5" + { + quatd xformOp:orient = (-0.000003635883331298828, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.1300000101327896, 0.0000022727249415765982, 0.2174999713897705) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_24" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link6" + { + quatd xformOp:orient = (-0.7071106433868408, 0.7071029543876648, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.1300000101327896, 0.0000022727249415765982, 0.2174999713897705) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "link6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_26" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "link7" + { + quatd xformOp:orient = (-0.000003635883331298828, 1, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.20600003004074097, 0.0000033365486160619184, 0.12049996852874756) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link_eef" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "link7" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + token visibility = "inherited" + quatd xformOp:orient = (0.70711, 0.7071035624, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "collisions" ( + instanceable = false + ) + { + def Xform "end_tool" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_28" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/ufactory_xarm7/payloads/geometries.usd b/ufactory_xarm7/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..b651ca7f7a0f80f7be52ed09d51cf998c6c9274d --- /dev/null +++ b/ufactory_xarm7/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c98ef6e05ee1693659f5de512abb9f9efd3140e3600d7d8cfe3a46259215093 +size 12193746 diff --git a/ufactory_xarm7/payloads/instances.usda b/ufactory_xarm7/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..be6081c2092792bfd993994b070065cb6d1d1213 --- /dev/null +++ b/ufactory_xarm7/payloads/instances.usda @@ -0,0 +1,1518 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_1_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_7" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_7" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_8" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_8" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_9" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_9" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_10" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_10" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_11" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_11" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "j____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_12" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_12" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "DefaultMaterial" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_14" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_14" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_15" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_15" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_16" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_16" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_17" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_17" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_18" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_18" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_19" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_19" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_20" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_20" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_21" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_21" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_22" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_22" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_23" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_23" + { + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_24" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_24" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_25" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_25" + { + over "subset____________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset_______________" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "subset____________0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_26" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_26" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_27" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_27" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "material_______________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_28" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_28" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "material____________" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/ufactory_xarm7/payloads/materials.usda b/ufactory_xarm7/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..17c9e095ada4ba00521ac0d7bd78d0cce6101f18 --- /dev/null +++ b/ufactory_xarm7/payloads/materials.usda @@ -0,0 +1,881 @@ +#usda 1.0 +( + customLayerData = { + } + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "DefaultMaterial" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "DefaultMaterial" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "j____________" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "j____________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Black" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Red" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.8, 0, 0) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8, 0, 0) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_Silver" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.753, 0.753, 0.753) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.753, 0.753, 0.753) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_White" + { + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material_______________" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "material_______________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (0.5, 0.5, 0.5) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5, 0.5, 0.5) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } + + def Material "material____________" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "paint" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "material____________" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @../materials/mdl/OmniPBR.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniPBR" + color3f inputs:diffuse_color_constant = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Albedo" + ) + color3f inputs:emissive_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + dictionary range = { + float3 max = (1, 1, 1) + float3 min = (0, 0, 0) + } + } + displayGroup = "Emissive" + ) + float inputs:emissive_intensity = 10000 ( + customData = { + double default = 10000 + dictionary range = { + double max = 100000 + double min = 0 + } + } + displayGroup = "Emissive" + ) + bool inputs:enable_emission = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Emissive" + ) + bool inputs:enable_opacity = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + bool inputs:enable_opacity_texture = 0 ( + customData = { + bool default = 0 + } + displayGroup = "Opacity" + ) + float inputs:opacity_constant = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + int inputs:opacity_mode = 1 ( + customData = { + int default = 1 + dictionary range = { + int max = 3 + int min = 0 + } + } + displayGroup = "Opacity" + renderType = "::base::mono_mode" + sdrMetadata = { + string __SDR__enum_value = "mono_average" + string options = "mono_alpha:0|mono_average:1|mono_luminance:2|mono_maximum:3" + } + ) + float inputs:opacity_threshold = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Opacity" + ) + float inputs:texture_rotate = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 360 + double min = 0 + } + } + displayGroup = "UV" + ) + float2 inputs:texture_scale = (1, 1) ( + customData = { + float2 default = (1, 1) + } + displayGroup = "UV" + ) + float2 inputs:texture_translate = (0, 0) ( + customData = { + float2 default = (0, 0) + } + displayGroup = "UV" + ) + token outputs:out + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:metallic = 0 + float inputs:opacity = 1 + float inputs:roughness = 0.5 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/ufactory_xarm7/payloads/robot.usda b/ufactory_xarm7/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..d01c386f04f0b4d58774e7d7cc45cbac549b2a6c --- /dev/null +++ b/ufactory_xarm7/payloads/robot.usda @@ -0,0 +1,429 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:description + string isaac:namespace ( + displayName = "Namespace" + doc = "Namespace of the prim in Isaac Sim" + ) + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "gripper" ( + prepend apiSchemas = ["IsaacRobotAPI"] + ) + { + string isaac:description + string isaac:namespace + rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + ] + rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] + + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "left_finger_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride ( + displayName = "Name Override" + doc = "Name override for prim lookup in base name search" + ) + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "right_finger_joint" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "xarm_gripper_base_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "left_outer_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "left_finger" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "left_inner_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "right_inner_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "right_outer_knuckle" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "right_finger" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint2" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint3" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint4" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint5" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint6" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + + over "joint7" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } + } + + over "world" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "link_base" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "link1" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link2" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link3" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link4" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link5" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link6" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "link7" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + + over "link_eef" ( + prepend apiSchemas = ["IsaacSiteAPI"] + ) + { + } + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + custom string isaac:nameOverride + float[] isaac:physics:AccelerationLimit + float[] isaac:physics:JerkLimit + custom int isaac:physics:Rot_X:DofOffset + custom int isaac:physics:Rot_Y:DofOffset + custom int isaac:physics:Rot_Z:DofOffset + custom int isaac:physics:Tr_X:DofOffset + custom int isaac:physics:Tr_Y:DofOffset + custom int isaac:physics:Tr_Z:DofOffset + } +} diff --git a/ufactory_xarm7/runnables/physics/mujoco.usda b/ufactory_xarm7/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..dc1fd99f81c21d722d0542d4107110bc24de700c --- /dev/null +++ b/ufactory_xarm7/runnables/physics/mujoco.usda @@ -0,0 +1,458 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +def "UF_ROBOT" +{ + over "gripper" + { + over "xarm_gripper_base_link" + { + over "collisions" + { + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" + { + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_finger" + { + over "collisions" + { + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" + { + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" + { + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" + { + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_finger" + { + over "collisions" + { + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "left_finger_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "right_finger_joint" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + } + + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_14" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_16" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_18" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_20" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_22" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_24" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" + { + over "mesh_26" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link7" + { + over "collisions" + { + over "end_tool" + { + over "mesh_28" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_UF_ROBOT_gripper_joints_drive_joint" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -31.24843988679391, -0.012499376248202255] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 1000 + double mjc:forceRange:min = -1000 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint1" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -2124.470344950797, -0.8497881241491857] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 50 + double mjc:forceRange:min = -50 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint2" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -3202.1498318944014, -1.2808599322454963] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 50 + double mjc:forceRange:min = -50 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint3" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -8521.427063608215, -3.4085709005753673] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint4" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -13238.674373724938, -5.2954695691729805] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint5" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -10459.0702060029, -4.183627897303033] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint6" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -581.6078745448075, -0.23264315336108365] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 20 + double mjc:forceRange:min = -20 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_UF_ROBOT_joints_joint7" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -118.65785750701838, -0.047463141289923974] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 20 + double mjc:forceRange:min = -20 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "joint7" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } +} + diff --git a/ufactory_xarm7/runnables/physics/newton.usda b/ufactory_xarm7/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..d75da50ef12143aaf0c70b7583db050b41d4257e --- /dev/null +++ b/ufactory_xarm7/runnables/physics/newton.usda @@ -0,0 +1,396 @@ +#usda 1.0 +( + defaultPrim = "UF_ROBOT" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "xarm_gripper_base_link" + { + over "collisions" + { + over "base_link" + { + over "mesh" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" + { + over "left_outer_knuckle" + { + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_finger" + { + over "collisions" + { + over "left_finger" + { + over "mesh_4" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" + { + over "left_inner_knuckle" + { + over "mesh_6" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" + { + over "right_inner_knuckle" + { + over "mesh_8" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" + { + over "right_outer_knuckle" + { + over "mesh_10" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_finger" + { + over "collisions" + { + over "right_finger" + { + over "mesh_12" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 10 + float drive:angular:physics:stiffness = 3.2725 + float newton:damping = 0.109083 + float newton:velocityLimit = 114.59155 + } + + over "left_finger_joint" ( + prepend apiSchemas = ["NewtonJointAPI", "NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["NewtonJointAPI", "NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["NewtonJointAPI", "NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["NewtonJointAPI", "NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + + over "right_finger_joint" ( + prepend apiSchemas = ["NewtonJointAPI", "NewtonMimicAPI"] + ) + { + float newton:mimicCoef0 = -0 + float newton:mimicCoef1 = 1 + bool newton:mimicEnabled = 1 + rel newton:mimicJoint = + } + } + } + + over "world" + { + over "collisions" + { + over "link_base" + { + over "mesh_14" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" + { + over "mesh_16" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" + { + over "mesh_18" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" + { + over "mesh_20" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" + { + over "mesh_22" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" + { + over "mesh_24" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" + { + over "mesh_26" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link7" + { + over "collisions" + { + over "end_tool" + { + over "mesh_28" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 10.4219 + float newton:damping = 0.347398 + float newton:velocityLimit = 179.90874 + } + + over "joint2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 45 + float newton:damping = 0.347398 + float newton:velocityLimit = 179.90874 + } + + over "joint3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 7.8165 + float newton:damping = 0.260549 + float newton:velocityLimit = 179.90874 + } + + over "joint4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:maxForce = 100 + float drive:angular:physics:stiffness = 60 + float newton:damping = 0.625873 + float newton:velocityLimit = 179.90874 + } + + over "joint5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 6.2532 + float newton:damping = 0.208439 + float newton:velocityLimit = 179.90874 + } + + over "joint6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.1688 + float newton:damping = 0.138959 + float newton:velocityLimit = 179.90874 + } + + over "joint7" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.1688 + float newton:damping = 0.138959 + float newton:velocityLimit = 179.90874 + } + } +} + diff --git a/ufactory_xarm7/runnables/physics/physx.usda b/ufactory_xarm7/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..b14b7f6bf98d19ef827e541852ec60eaf458d8e9 --- /dev/null +++ b/ufactory_xarm7/runnables/physics/physx.usda @@ -0,0 +1,462 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +over "UF_ROBOT" +{ + over "gripper" + { + over "joints" + { + over "drive_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 114.59155 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "left_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "left_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_inner_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_outer_knuckle_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "right_finger_joint" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysxMimicJointAPI:rotX", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxMimicJoint:rotX:dampingRatio = 0.005 + float physxMimicJoint:rotX:gearing = -1 + float physxMimicJoint:rotX:naturalFrequency = 2500 + float physxMimicJoint:rotX:offset = 0 + rel physxMimicJoint:rotX:referenceJoint = + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "xarm_gripper_base_link" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "base_link" + { + over "mesh" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_outer_knuckle" + { + over "mesh_2" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_finger" + { + over "mesh_4" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "left_inner_knuckle" + { + over "mesh_6" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_inner_knuckle" + { + over "mesh_8" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_outer_knuckle" + { + over "mesh_10" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "right_finger" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "right_finger" + { + over "mesh_12" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:articulationEnabled = 0 + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + } + + over "joints" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + + over "joint7" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 0.0 + float physxJoint:maxJointVelocity = 179.90874 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "world" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link_base" + { + over "mesh_14" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link1" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link1" + { + over "mesh_16" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link2" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link2" + { + over "mesh_18" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link3" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link3" + { + over "mesh_20" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link4" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link4" + { + over "mesh_22" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link5" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link5" + { + over "mesh_24" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link6" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "link6" + { + over "mesh_26" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "link7" + { + over "collisions" ( + ) + { + rel collection:collisionmeshes:includes = + + over "end_tool" + { + over "mesh_28" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/ufactory_xarm7/xarm7.usda b/ufactory_xarm7/xarm7.usda new file mode 100644 index 0000000000000000000000000000000000000000..4be89a0a833d39b6122bb8e2cb73c3bfe75234ff --- /dev/null +++ b/ufactory_xarm7/xarm7.usda @@ -0,0 +1,585 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/UF_ROBOT" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + string "optional requirements" = "['com.nvidia.simready.MUJOCO.DJ.002']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.30790877, 0.22742647, 0.64614147) + string asset_license = "Unknown - not verified; no permissions asserted" + string asset_name = "xarm7" + string asset_type = "robot" + string author = "Ufactory" + string category = "robotic arm" + string distribution_policy = "Internal handling policy: exclude from redistribution until applicable rights are verified. This policy grants no license or viewing permission." + string license_status = "unverified" + double mass = 12.06848942860961 + string qcode = "Q40687" + int rigid_body_count = 15 + string source_file = "Ufactory/xarm7/xarm7.usda" + string usage_clearance = "Pending source-license or rights-holder verification" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "UF_ROBOT" + endTimeCode = 0 + metersPerUnit = 1 + startTimeCode = -1 + upAxis = "Z" +) + +def Xform "UF_ROBOT" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + string Variant_Set = "none" + } + variantSets = ["Variant_Set", "Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "gripper" + { + over "xarm_gripper_base_link" + { + over "collisions" + { + token visibility = "invisible" + + over "base_link" ( + instanceable = false + ) + { + over "mesh" + { + } + } + } + } + + over "left_outer_knuckle" + { + over "collisions" + { + over "left_outer_knuckle" ( + instanceable = false + ) + { + over "mesh_2" + { + token visibility = "invisible" + } + } + } + } + + over "left_finger" + { + over "collisions" + { + over "left_finger" ( + instanceable = false + ) + { + over "mesh_4" + { + token visibility = "invisible" + } + } + } + } + + over "left_inner_knuckle" + { + over "collisions" + { + over "left_inner_knuckle" ( + instanceable = false + ) + { + over "mesh_6" + { + token visibility = "invisible" + } + } + } + } + + over "right_inner_knuckle" + { + over "collisions" + { + over "right_inner_knuckle" ( + instanceable = false + ) + { + over "mesh_8" + { + token visibility = "invisible" + } + } + } + } + + over "right_outer_knuckle" + { + over "collisions" + { + over "right_outer_knuckle" ( + instanceable = false + ) + { + over "mesh_10" + { + token visibility = "invisible" + } + } + } + } + + over "right_finger" + { + over "collisions" + { + over "right_finger" ( + instanceable = false + ) + { + over "mesh_12" + { + token visibility = "invisible" + } + } + } + } + } + + over "world" + { + over "collisions" + { + over "link_base" ( + instanceable = false + ) + { + over "mesh_14" + { + token visibility = "invisible" + } + } + } + } + + over "link1" + { + over "collisions" + { + over "link1" ( + instanceable = false + ) + { + over "mesh_16" + { + token visibility = "invisible" + } + } + } + } + + over "link2" + { + over "collisions" + { + over "link2" ( + instanceable = false + ) + { + over "mesh_18" + { + token visibility = "invisible" + } + } + } + } + + over "link3" + { + over "collisions" + { + over "link3" ( + instanceable = false + ) + { + over "mesh_20" + { + token visibility = "invisible" + } + } + } + } + + over "link4" + { + over "collisions" + { + over "link4" ( + instanceable = false + ) + { + over "mesh_22" + { + token visibility = "invisible" + } + } + } + } + + over "link5" + { + over "collisions" + { + over "link5" ( + instanceable = false + ) + { + over "mesh_24" + { + token visibility = "invisible" + } + } + } + } + + over "link6" + { + over "collisions" + { + over "link6" ( + instanceable = false + ) + { + over "mesh_26" + { + token visibility = "invisible" + } + } + } + } + + over "link7" + { + over "collisions" + { + over "end_tool" ( + instanceable = false + ) + { + over "mesh_28" + { + token visibility = "invisible" + } + } + } + } + variantSet "Variant_Set" = { + "none" ( + prepend payload = @./payloads/Variant_Set/none.usda@ + ) { + + } + "xarm_gripper" ( + prepend payload = @./payloads/Variant_Set/xarm_gripper.usda@ + ) { + + } + } + variantSet "Sensor" = { + "none" ( + prepend payload = @./payloads/Sensor/none.usda@ + ) { + + } + "sensors" ( + prepend payload = @./payloads/Sensor/sensors.usda@ + ) { + + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} + diff --git a/unitree_z1/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/unitree_z1/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..c5bc833a34876cdb758aefa31ddf35d4f1eaa67e --- /dev/null +++ b/unitree_z1/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.0", + "profile": "Package-Candidate", + "profile_version": "1.0.0", + "timestamp": "2026-10-23T23:04:32", + "assets": [ + { + "asset": "z1.usda", + "features": [ + { + "FET_031_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [] + } + }, + { + "FET_033_STANDARD": { + "version": "0.1.0", + "passed": true, + "failing_requirements": [], + "dependencies": [ + { + "FET_031_STANDARD": { + "version": "0.1.0" + } + } + ] + } + } + ] + } + ] +} diff --git a/unitree_z1/.metadata/com.nvidia.simready.packaging.bom.json b/unitree_z1/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..48ff624b87483141dda0f7fa86d98d01e47d3ab4 --- /dev/null +++ b/unitree_z1/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,294 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.z1.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "60e484b74b1351a30b20fcb4f807d9fdef382d1b6f135d5e8b7e2adb68024ca6", + "sha256": "743d426e79e708d3e87d78b15ffff032c4cc1567fb6df707056a4c0220c5f006" + } + }, + { + "relative_path": ".thumbs/256x256/z1.usda.png", + "size": 54196, + "hash": { + "sha256-flat-1mb": "fb507fcea4fc12ccd50a2bac56ad97d873c2f323c2da430f664f5283a27a9003", + "sha256": "6de56191fe9f7e8e483e0f2e966d6dd9191bef0e43dca05d3d970021a1d2410e" + } + }, + { + "relative_path": ".thumbs/z1.thumb.usd", + "size": 6737, + "hash": { + "sha256-flat-1mb": "5900364b620fecdd12d3f94bc33e510c6a97977d27a326c7ba20b72862fc0712", + "sha256": "9e7b086d3b8e3de9ae7752f4de160047b6ed0e1146f1101396ca3862920530e9" + } + }, + { + "relative_path": "materials/mdl/LICENSE.md", + "size": 3220, + "hash": { + "sha256-flat-1mb": "d54635995b7794c6549d0f7c70586e739c1e24cb671ce966e64a8c1a6703a452", + "sha256": "d62e1bd5e34d0ca6f92f0e9f10670ee0cd586695e20f0a838a8f859119589683" + } + }, + { + "relative_path": "materials/mdl/OmniPBR.mdl", + "size": 13969, + "hash": { + "sha256-flat-1mb": "1c58f77068df165a71676dfde42a4b7e4932a82cacacfc7a205ae94fc0332aaf", + "sha256": "c902cc38dc97ff6a89fe94dca94edfb523a30e3749d3708610a136867c3357bf" + } + }, + { + "relative_path": "materials/mdl/OmniPBRBase.mdl", + "size": 17274, + "hash": { + "sha256-flat-1mb": "4b54e7fb8bc92191512851b3acc6fc6fa9863f80d98ffece8f0cb9b99f5f4535", + "sha256": "701f37299b44106842bdbe025de52eedec391e35b038f61c4ed4d25bd98e7db1" + } + }, + { + "relative_path": "materials/mdl/OmniPBR_ClearCoat.mdl", + "size": 27433, + "hash": { + "sha256-flat-1mb": "b1f146a3767a5012936e3d246f2697c3536c2f72b5c5963d3bca0998d02f8931", + "sha256": "085ba661b49042570e24cda09c939e5aebf312ae332af92744a99bd3abbfbee4" + } + }, + { + "relative_path": "materials/mdl/OmniSurface.mdl", + "size": 62120, + "hash": { + "sha256-flat-1mb": "72ff357d666a5db60c67cf1c6bccf569b78db9d876394d1c51a0edc1ec987683", + "sha256": "582465fe5eb9bffede83ebf1eedff941f66f8fc3189cedab3653bc4d14bc59bb" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/.thumbs/OmniHairBase.png", + "size": 38058, + "hash": { + "sha256-flat-1mb": "cf75267939cf22709c95ecd55aabd5b8a99f94f1bd8f13ef89b0a5c718393572", + "sha256": "6c199f719bb31cdc60ff9b8e1d3b206be699d98b6c57e178ecf03abe29918f84" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/.thumbs/OmniSurfaceBase.png", + "size": 67332, + "hash": { + "sha256-flat-1mb": "a8b2d4ecff1d93d4892f1395c323eb1ab141616e01e40737f53068643be7ea47", + "sha256": "98778cb33e32234e304c918a3dd5299b550ad1d84d6811aac6e59a69ea61883c" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/.thumbs/OmniSurfaceBlendBase.png", + "size": 93920, + "hash": { + "sha256-flat-1mb": "50e75ccbae9444fb652364d936e3c3a8cad67cabe73c033206b5f413581b8b6b", + "sha256": "650831bc8c7d44733ea3124d97537c9629e1c99b4637f5495d773b037a67666e" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/.thumbs/OmniSurfaceLiteBase.png", + "size": 63206, + "hash": { + "sha256-flat-1mb": "ec925575ccad5816fcf8b4db9470d224775961bf4556b97cc29cd41571027555", + "sha256": "f3786412c4aaf7366af3d41a0f4d4227b6978b6f89ea8c5d92150dcd67325158" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/OmniHairBase.mdl", + "size": 11039, + "hash": { + "sha256-flat-1mb": "bdcc960519eb192b90149e4f568b0c79f979153801c2c7a0053f61aaccec57e1", + "sha256": "ad48326b3802827ce1cdd96537768210787cb0a0e7eb65e0475bb762030529d5" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/OmniImage.mdl", + "size": 25139, + "hash": { + "sha256-flat-1mb": "d4132b88dbf57bdd0d83ac202a030b811b79a8449f6f742f2b19ab857919e342", + "sha256": "4fed6f985c6d81b939ebce1217a3e39b0e576c139d9cf4bde054b03f38770db8" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/OmniShared.mdl", + "size": 16636, + "hash": { + "sha256-flat-1mb": "f923357f6cdead06e1f10a393d01d87dc6684d40299a2a093e7d8e2fce569e13", + "sha256": "7ad1ead48b7546c71be538e20fae54ae4c2861d50b4486a9b622cc1793739bde" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/OmniSurfaceBase.mdl", + "size": 30589, + "hash": { + "sha256-flat-1mb": "2b471a5d7b0721964d9aa0163b58de96f5e98447d5e556793a078c4ae18dec05", + "sha256": "afe27e705383382e14afc248bef803fabd363d73cbe431f09febea9e191c7127" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/OmniSurfaceBlendBase.mdl", + "size": 6673, + "hash": { + "sha256-flat-1mb": "f4f01d52b63ada0b90179e912b6f0ff9b3ecf9238bab700d73e55af6bfa80949", + "sha256": "f88c7fbd59518e58fdeca9271b94b24b99775a41e9a21af321d96be68a155fcd" + } + }, + { + "relative_path": "materials/mdl/OmniSurface/OmniSurfaceLiteBase.mdl", + "size": 15450, + "hash": { + "sha256-flat-1mb": "b3ea6ad4159caf72911ac72c1b5821b62043c26f1c1a238b47359208087c9fb5", + "sha256": "9f6817118f4a089dc87183d8b1c9e83b2bee42e80c13c2577b6cc74792c949a2" + } + }, + { + "relative_path": "materials/mdl/OmniSurfaceLite.mdl", + "size": 41838, + "hash": { + "sha256-flat-1mb": "4d5c7b897aac2fd676bda330ad803fa4bb50b1713f3bd9382e9837cd9b1ba1bf", + "sha256": "9b0c905f9a04cb337433ac3184c58aa96d91c4afbb04ba9dacccb062d51e6fe6" + } + }, + { + "relative_path": "materials/mdl/OmniSurfacePresets.mdl", + "size": 271620, + "hash": { + "sha256-flat-1mb": "8e59a1f4597350133979c23b193deae89e6432acf1166e25539445ccb2b4de0d", + "sha256": "035e22809975223527724466e40357556c6416069f2882faa2d076709c379310" + } + }, + { + "relative_path": "materials/mdl/aux_definitions.mdl", + "size": 101769, + "hash": { + "sha256-flat-1mb": "6a5ffcb49e18ade213c3a4d79cf171d66612f9eee045074a0b937dbe4cf01ef6", + "sha256": "ebb81c8977aeb30790399ec7aaa7f2f76cb23afb434f56201ef152aba45a6e81" + } + }, + { + "relative_path": "materials/mdl/core_definitions.mdl", + "size": 201537, + "hash": { + "sha256-flat-1mb": "54bdc55e3899f126b1e271eef4de9c5966b1390fb3143872846f29f0ca68378d", + "sha256": "052aec260e8dfef5d671545fc2fc28c0c478a5b043041c65a833b2a6d81bf950" + } + }, + { + "relative_path": "materials/mdl/support_definitions.mdl", + "size": 147454, + "hash": { + "sha256-flat-1mb": "2b93c649c03f3ef48fb24cc6baba953df1f9dd4e7e860719bc3322fc3e789aba", + "sha256": "bb372f21b6e81d293b99fea6819a8309e2c33c732c7151752b4b33dade177f2e" + } + }, + { + "relative_path": "payloads/Physics/mujoco.usda", + "size": 2957, + "hash": { + "sha256-flat-1mb": "3e9d92833719398ad869dbd425463816f077a3fe1a7557c943bcd9c392e284b1", + "sha256": "729e9e5cc557912bfe62dae5c07e75b5d49367bbbc9bb851b9d65354021f6c12" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 10329, + "hash": { + "sha256-flat-1mb": "5c8f0ca210e50e451a855d525ebee984c1b02cced7d2b6e7580a180537b7cb63", + "sha256": "ba23c963677d2f4282a8670ab16afccddc528c7dfecfa494b11e2bf6c3895dee" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1737, + "hash": { + "sha256-flat-1mb": "44f963f460f7b22488870112157b8df0fe9fdc6444f354beae8da18a54fc8f79", + "sha256": "fb6111a2da1da1f8025ceeb5f1a7a90d21e0712758e3d14cf99257dff1ac4d7e" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 12684, + "hash": { + "sha256-flat-1mb": "c55fa22f58f2ea4786ddeb124e459d53a30c552406d902916f6c3f426fe8d2f0", + "sha256": "9ca7d50e1cb2a312c675ad83fe933551e87b0dee6f9b53996cdebed18098f112" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 12815717, + "hash": { + "sha256-flat-1mb": "d83c5b56586e9ba2082edfa999a7eb05082ae391e72f91089bb3f86df158aa0c", + "sha256": "d39c3ae2c1d034215076d1ac7bf87feb14ea3840973b90f2c9ffc53ae8114d71", + "sha256-first1m": "b04b8739755e8c597b812ea5b6a4c381dc6f59703ce27e43ce98c0a375528015" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 10068, + "hash": { + "sha256-flat-1mb": "e5f50ba5f28416c9311c55b109f0b9b6cf5a79042a1d8acac3b4f8087323894a", + "sha256": "6810324858d0dbf6a91d1a367f4141b1d07fc3a70f3a719e1152da51ee060f0a" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 4762, + "hash": { + "sha256-flat-1mb": "0f32e539b4bf26b1e80d7725a4826143365058eb96d694f436d2d369db8fe91d", + "sha256": "597f46d235a5bcd281e49ce997b6d67c30375863d519f7d1be35d6a9f297efed" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 2486, + "hash": { + "sha256-flat-1mb": "00534bc263dff0f108469b6659ebd5fffb05157b3c993b7a65c6ca26553b3f50", + "sha256": "dc990e1b4821a471bb1bab3be867d2b64cde083c4623a682665e57bd2f3f719f" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 6773, + "hash": { + "sha256-flat-1mb": "7dd9491acb713a80773dbf2c3501a54b016a852e6fe78bf61704875d21696dcc", + "sha256": "f9b5bdb85544e24002f3dbcd976a5981e769ff0a51d47e3b86f3417fcd2f1724" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 2142, + "hash": { + "sha256-flat-1mb": "ae92173a5096ae2cdea271afb7699a4764ab553ccc7d57c062fd21ead1c23282", + "sha256": "873ac1415cec87bbae5f22bb98daa3a6c72228905422f77cf0201228bb6387e2" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 2534, + "hash": { + "sha256-flat-1mb": "2377449332b38cd14707880b79e48d8b5aa11838c5a081e4688070032238d6c5", + "sha256": "b0831b6a5c3b765e6a108072a9f2aad0cce9179bdd1a39471c8dbac272f3af82" + } + }, + { + "relative_path": "z1.usda", + "size": 15388, + "hash": { + "sha256-flat-1mb": "c7ebaebbd6c778e15fe1eb162b7441b881b4aa9473198cf7c50c5abf1ac2f2ab", + "sha256": "ed6f7eb765bb13a84c336525c1b69bd0c8d46e1f629ec6e25f4ca399e75ed18c" + } + } + ] +} \ No newline at end of file diff --git a/unitree_z1/.metadata/com.nvidia.simready.root_usds.json b/unitree_z1/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..17b65d9abe0b938413916a0ce3a97237d2169484 --- /dev/null +++ b/unitree_z1/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "z1.usda" + ] +} diff --git a/unitree_z1/.simready/validation.json b/unitree_z1/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/unitree_z1/.simready/validation.json @@ -0,0 +1,223 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robot-Body", + "profile_version": "3.0.0", + "validated_features": { + "2026-10-20": { + "CAP000_Core.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP000_Core.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP000_Core.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP003_RigidBody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP003_RigidBody.MuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP004_Multibody.RobotMuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP021_RobotCore.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "CAP022_DrivenJoints.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP004_Multibody.RobotMuJoCo.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP023_RobotMaterials.Isaac.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.MuJoCo.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP024_BaseArticulation.PhysX.0-1-0": { + "blocking_failure": false, + "dependencies": "['CAP024_BaseArticulation.OpenUSD.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "CAP025_RosBridge.Ros.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.ROS.001']", + "passed": false, + "version": "0-1-0" + }, + "CAP031_SelfContainedPackage.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "CAP033_SimReadyPackage.OpenUSD.0-4-0": { + "blocking_failure": false, + "dependencies": "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']", + "passed": true, + "version": "0-4-0" + }, + "CAP100_IsaacComposition.Isaac.0-3-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-3-0" + }, + "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1-0-1" + }, + "FET003_RigidBody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET003_RigidBody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET003_RigidBody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.Newton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET004_Multibody.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET004_Multibody.PhysX.0-4-0": { + "blocking_failure": false, + "dependencies": "['FET003_RigidBody.PhysX.0-4-0']", + "passed": true, + "version": "0-4-0" + }, + "FET004_Multibody.RobotNewton.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET006_Materials.MDL.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-2-0" + }, + "FET006_Materials.Openpbr.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET010_DisplayColor.OpenUSD.0-1-0": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.Isaac.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET022_DrivenJoints.PhysX.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.Newton.0-1-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.RobotNewton.0-1-0']", + "passed": true, + "version": "0-1-0" + }, + "FET022_DrivenJoints.OpenUSD.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.OpenUSD.0-2-0']", + "passed": true, + "version": "0-2-0" + }, + "FET022_DrivenJoints.PhysX.0-2-0": { + "blocking_failure": false, + "dependencies": "['FET004_Multibody.PhysX.0-4-0']", + "passed": true, + "version": "0-2-0" + } + } + } + } + } +} diff --git a/unitree_z1/.thumbs/256x256/.z1.usda.last_generated b/unitree_z1/.thumbs/256x256/.z1.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..ed55add8880a0f3a94fc111ee921935a8144a8f0 --- /dev/null +++ b/unitree_z1/.thumbs/256x256/.z1.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:46:23 \ No newline at end of file diff --git a/unitree_z1/.thumbs/256x256/z1.usda.png b/unitree_z1/.thumbs/256x256/z1.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..db36375ce4ffccc3fcc794d522a07a57908ed893 --- /dev/null +++ b/unitree_z1/.thumbs/256x256/z1.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6de56191fe9f7e8e483e0f2e966d6dd9191bef0e43dca05d3d970021a1d2410e +size 54196 diff --git a/unitree_z1/.thumbs/z1.thumb.usd b/unitree_z1/.thumbs/z1.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..3aafe87b01c9406e57f5165d95cebb2eaa1c8237 Binary files /dev/null and b/unitree_z1/.thumbs/z1.thumb.usd differ diff --git a/unitree_z1/com.nvidia.simready.packaging.json b/unitree_z1/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..3c21ec2c8f5977a843a9358a6ee39eb915e61968 --- /dev/null +++ b/unitree_z1/com.nvidia.simready.packaging.json @@ -0,0 +1,31 @@ +{ + "format_version": "1.0", + "package_id": "unitree_z1.1.0.0", + "license": "unknown", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "ad151646f6ed41ea6d0ffd6661ca0da43a1c469e64337df362814bb46195da51" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "e1ccd5e57475512c0f3f6beed71eff7cd7372134386132b64b06c1757f8b6907" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "96ba49113f94827f515d79972ab5295541f8840889a82112e8b4db6f7b858d92" + } + } + ], + "content_hash": { + "sha256": "7ffe8022a4635cedbdb3b09d1e7a6c3678ab25928386098f252aa9c0912480d7" + }, + "package_hash": { + "sha256": "1251d76751d2203e81603c5dd6c43a2cdf7230be8fb9a49fcb2b4e6b1f040005" + } +} \ No newline at end of file diff --git a/unitree_z1/materials/mdl/LICENSE.md b/unitree_z1/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/unitree_z1/materials/mdl/LICENSE.md @@ -0,0 +1,73 @@ +# NVIDIA Omniverse Core Materials Licenses + +## Primary License +This project is primarily licensed under the BSD-3-Clause License. + +``` +Copyright (c) 1986-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder 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 HOLDER 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. +``` + +## Third-Party Licenses + +### Apache License 2.0 +The following components are licensed under the Apache License 2.0: + +#### MaterialX Components +Files in `/source/mdl/materialx` are licensed under Apache License 2.0 per the MaterialX project: +https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE + +``` +Copyright Contributors to the MaterialX Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` + +## SPDX License Identifiers +Files in this project use the following SPDX license identifiers: +- `SPDX-License-Identifier: BSD-3-Clause` - Used for NVIDIA-owned code +- `SPDX-License-Identifier: Apache-2.0` - Used for MaterialX components + +## License Attribution +This project contains code from multiple sources: +1. NVIDIA Corporation (BSD-3-Clause) - Primary codebase +2. Academy Software Foundation (Apache-2.0) - MaterialX components + +## License Scope +- All files in the project are licensed under BSD-3-Clause unless explicitly stated otherwise +- Files in `/source/mdl/materialx` are licensed under Apache-2.0 +- All other files are licensed under BSD-3-Clause \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniPBR.mdl b/unitree_z1/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/unitree_z1/materials/mdl/OmniPBRBase.mdl b/unitree_z1/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniPBRBase.mdl @@ -0,0 +1,470 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +import ::anno::*; + +export float3 HemiOctahedronToUnitVector( float2 Oct ) [[ + anno::hidden() +]] +{ + Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5; + float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) ); + return math::normalize(N); +} + +export struct NormalData [[ + anno::hidden() +]] +{ + float3 normal; + float2 roughness; +}; + +export NormalData tangent_space_normal_roughness_texture( + uniform texture_2d texture + [[ + anno::description("The input texture"), + anno::usage("normal") + ]], + uniform float factor = 1.0f + [[ anno::description("Determines the degree of bumpiness") ]], + uniform bool flip_tangent_u = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + uniform bool flip_tangent_v = false + [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]], + base::texture_coordinate_info uvw = base::texture_coordinate_info() + [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]], + uniform float2 crop_u = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]], + uniform float2 crop_v = float2( 0.0, 1.0) + [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]], + uniform tex::wrap_mode wrap_u = tex::wrap_repeat + [[ anno::description("Wrapping mode in the u direction") ]], + uniform tex::wrap_mode wrap_v = tex::wrap_repeat + [[ anno::description("Wrapping mode in the v direction") ]], + uniform bool clip = false + [[ + anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"), + anno::hidden() + ]], + uniform float scale = 1. + [[ + anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float offset = 0. + [[ + anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"), + anno::unused() + ]], + uniform float animation_start_time = 0. + [[ anno::description("When to start playing first frame of the animation ") ]], + uniform int2 animation_crop = int2(0, 0) + [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]], + uniform tex::wrap_mode animation_wrap = tex::wrap_repeat + [[ anno::description("Defines what to do outside of regular animation time") ]], + uniform float animation_fps = 30 + [[ anno::description("Framerate to use for animation playback") ]] +) +[[ + anno::description("Interprets the color values of a bitmap as a vector in tangent space"), + anno::hidden(), + anno::noinline() +]] +{ + NormalData normalData; + normalData.roughness = float2(0); + normalData.normal = state::normal(); + + float frame = 0.0; + if(animation_crop != int2(0,0)) //only if we have an animation + { + frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation + switch ( animation_wrap) { + case tex::wrap_repeat: + frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x: + math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y; + break; + case tex::wrap_mirrored_repeat: + float animation_crop_2y = 2.0*animation_crop.y; + frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x: + math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x; + if(frame>animation_crop.y) + frame = animation_crop_2y-frame; + break; + case tex::wrap_clamp: + frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y); + break; + case tex::wrap_clip: + frame += animation_crop.x; + if(frame < animation_crop.x || frame > animation_crop.y) return normalData; + break; + } + } + + if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource + factor == 0.0f) + return normalData; + { + if (clip) { + if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) { + return normalData; + } + if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) { + return normalData; + } + } + bool pixel_flip_u = flip_tangent_u; + bool pixel_flip_v = flip_tangent_v; + //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile + if (wrap_u == tex::wrap_mirrored_repeat) { + if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1) + pixel_flip_u = ! pixel_flip_u; + else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0) + pixel_flip_u = ! pixel_flip_u; + } + if (wrap_v == tex::wrap_mirrored_repeat) { + if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1) + pixel_flip_v = ! pixel_flip_v; + else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0) + pixel_flip_v = ! pixel_flip_v; + } + + float3 transformed_tangent_u = uvw.tangent_u; + float3 transformed_tangent_v = uvw.tangent_v; + + if (pixel_flip_u) + transformed_tangent_u=-transformed_tangent_u; + if (pixel_flip_v) + transformed_tangent_v=-transformed_tangent_v; + + float3 tangent_space_normal; + float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame); + if(normal_raw.x > 1.5) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + normal_raw.x -= 0.5; + normal_raw.y -= 0.5; + tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0); + normalData.roughness = float2(normal_raw.z, normal_raw.w); + } + else + { + // regular + tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0; + normalData.roughness = float2(0); + } + + normalData.normal = math::normalize( + transformed_tangent_u * tangent_space_normal.x * factor + + transformed_tangent_v * tangent_space_normal.y * factor + + state::normal() * tangent_space_normal.z); + + return normalData; +} + + +export material OmniPBRBase( + + + // Albdeo // + + color diffuse_reflection_color = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Albedo Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflecitivity // + + float specular_reflection_roughness = float(0.0) [[ + anno::display_name("Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hidden() + ]], + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::description("Bias towards pure specular reflection"), + anno::in_group("Reflectivity"), + anno::hard_range(0.0, 1.0) + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(0.0, 1.0) + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emission_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + float emission_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::soft_range(0.0, 1000.0), + anno::enable_if("enable_emission == true") + ]], + + + // Geometry Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + uniform float geometry_opacity_threshold = 0.f + [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(0.0, 1.0) + ]], + + + // Clearcoat // + + uniform bool enable_coat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a coat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float coat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for coat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + color coat_color = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float coat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float coat_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(0.0, 1.0) + ]], + float2 coat_aniso_roughness = float2(0.0, 0.0) [[ + anno::display_name("Clearcoat aniso roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hidden() + ]], + float coat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the coat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(0.0, 4.0) + ]], + float3 clearcoat_geometry_normal = state::normal() [[ + anno::display_name("Clearcoat Normal"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]] + +) +[[ + anno::display_name("OmniPBR Base"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Omni Materials"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = let{ + + // Diffuse Bsdf // + + color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint; + + color base_color = tinted_diffuse_color; + + bsdf diffuse_bsdf = df::weighted_layer( + weight: 1.0, + layer: df::diffuse_reflection_bsdf( + tint: base_color, + roughness: float(0.0) + ), + base: bsdf(), + normal: geometry_normal + ); + + // Glossy Reflection Bsdf // + + float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1); + float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness + + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1); + bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: roughness_u, + roughness_v: roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf custom_curve_layer_bsdf = df::custom_curve_layer( + normal_reflectivity: 0.08, + grazing_reflectivity: 1.0, + exponent: 5.0, + weight: specular_level, + layer: ggx_smith_bsdf, + base: diffuse_bsdf, + normal: geometry_normal + ); + + bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf); + + bsdf omni_PBR_bsdf = df::weighted_layer( + weight: metalness, + layer: directional_factor_bsdf, + base: custom_curve_layer_bsdf, + normal: geometry_normal + ); + + // Clear Coat // + + float coat_roughness_u = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1); + float coat_roughness_v = math::clamp(coat_roughness * coat_roughness + + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1); + bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + mode: df::scatter_reflect + ); + + bsdf opaque_coat = df::weighted_layer( + weight: coat_transparency, + layer: ::df::tint( + tint: coat_color, + base: omni_PBR_bsdf + ), + base: ::df::diffuse_reflection_bsdf( + tint: coat_color + ) + ); + + bsdf omni_PBR_coated_bsdf = df::fresnel_layer( + ior: coat_ior, + weight: coat_weight, + layer: coat_bsdf, + base: opaque_coat, + normal: clearcoat_geometry_normal + ); + + bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf; + + color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0); + + float opacity_value = geometry_opacity; + float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0; + + material_emission emission = material_emission( + df::diffuse_edf(), + intensity: emission_value + ); + + material_surface surface = material_surface( + scattering: final_bsdf, + emission: emission + ); + + material_geometry geometry = material_geometry( + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ), + cutout_opacity: cutout_opacity + ); + +} in material( + surface: surface, + geometry: geometry +); diff --git a/unitree_z1/materials/mdl/OmniPBR_ClearCoat.mdl b/unitree_z1/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/unitree_z1/materials/mdl/OmniPBR_ClearCoat.mdl @@ -0,0 +1,711 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import core_definitions::file_texture; +import core_definitions::normalmap_texture; + +import OmniPBRBase::*; + +// Functions // + + +// Returns a matrix from R,T,S. inputs // + +uniform float4x4 rotation_translation_scale( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct a transformation matrix from euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0.0 , 0.0 , 0.0, + 0.0 , scaling.y , 0.0 , 0.0, + 0.0 , 0.0 , scaling.z , 0.0, + translation.x , translation.y , translation.z , 1.0); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0.0 , 0.0 , 0 , 1.0); + + return scale * rotate; +} + +// Returns the normal n in tangent space, given n is in internal space. // + +float3 transform_internal_to_tangent(float3 n) +{ + /* flip_tangent_v */ + return + n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+ + n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+ + n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z); +} + +// Returns the normal n in internal space, given n is in tangent space. +float3 transform_tangent_to_internal(float3 n) +{ + return state::texture_tangent_u(0) * n.x - + state::texture_tangent_v(0) * n.y + /* flip_tangent_v */ + state::normal() * n.z; +} + +// Returns a normal by adding a detail normal to a global normal. +export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + n_t = n_t + float3(0.,0.,1.); + nd_t = nd_t * float3(-1.,-1.,1.); + n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + +base::texture_return multiply_colors( + color color_1 = color(1.0, 1.0, 1.0), + color color_2 = color(.5, .5, .5), + float weight = 1.0 + ) +[[ + anno::hidden() +]] +{ + return base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: color_2, + weight: weight, + mode: base::color_layer_multiply + )), + base: color_1 + ); +} + + +// OmniPBR Clearcoat // + +export material OmniPBR_ClearCoat( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Clearcoat // + + uniform bool enable_clearcoat = false [[ + anno::display_name("Enable Clearcoat Layer"), + anno::description("Adds a clearcoat layer on top of the material when enabled"), + anno::in_group("Clearcoat") + ]], + float clearcoat_weight = float(1.0) [[ + anno::display_name("Clearcoat Weight"), + anno::description("Sets the weight for clearcoat layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + color clearcoat_tint = color(1.0) [[ + anno::display_name("Clearcoat Tint"), + anno::description("Clearcoat is tinted and affects the underlying material"), + anno::in_group("Clearcoat") + ]], + float clearcoat_transparency = float(1.0) [[ + anno::display_name("Clearcoat Transparency"), + anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_reflection_roughness = float(0.0) [[ + anno::display_name("Clearcoat Roughness"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float clearcoat_ior = float(1.56) [[ + anno::display_name("Clearcoat IOR"), + anno::description("Sets the Index of refraction for the clearcoat layer"), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(4.0)) + ]], + uniform float clearcoat_bump_factor = float(1.0) [[ + anno::display_name("Clearcoat Normal Map Strength"), + anno::description("Strength of normal map."), + anno::in_group("Clearcoat"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[ + anno::display_name("Clearcoat Normal Map"), + anno::description("Enables the usage of the normalmap texture"), + anno::in_group("Clearcoat"), + anno::usage("normal") + ]], + uniform float2 clearcoat_texture_translate = float2(0.0) [[ + anno::display_name("Clearcoat Texture Translate"), + anno::description("Controls the position of the clearcoat texture"), + anno::ui_order(1), + anno::in_group("UV") + ]], + uniform float clearcoat_texture_rotate = float(0.0) [[ + anno::display_name("Clearcoat Texture Rotate"), + anno::description("Rotates angle of the clearcoat texture in degrees"), + anno::ui_order(2), + anno::in_group("UV") + ]], + uniform float2 clearcoat_texture_scale = float2(1.0) [[ + anno::display_name("Clearcoat Texture Tiling"), + anno::description("Controls the repetition of the clearcoat texture"), + anno::ui_order(3), + anno::in_group("UV") + ]], + float clearcoat_flatten = float(1.0) [[ + anno::display_name("Clearcoat Flatten"), + anno::description("Flattens the clearcoat to even out the underlying bump maps"), + anno::in_group("Clearcoat"), + anno::hard_range(float(0.0), float(1.0)) + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR ClearCoat "), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 1), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic")) +]] = let { + + // UVW lookup and transformation // + base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object; + + base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection( + coordinate_system: the_system, + texture_space: uv_space_index, + projection_type: base::projection_cubic + ) : + base::coordinate_source( + coordinate_system: base::texture_coordinate_uvw, + texture_space: uv_space_index + ); + + base::texture_coordinate_info transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(texture_scale.x, texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ), + translation: float3(texture_translate.x, texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ), + translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0) + ), + coordinate: uvw + ); + + base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0), + rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ), + translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f) + ), + coordinate: uvw + ); + + // Normal calculations // + OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0)); + + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: normalmap_texture, + factor: bump_factor, + uvw: transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + //flip_tangent_v: true + + ) : defaultData; + float3 the_normal = normal_data.normal; + + OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: detail_normalmap_texture, + factor: detail_bump_factor, + uvw: detail_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 detail_normal = detail_normal_data.normal; + + OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + texture: clearcoat_normalmap_texture, + factor: clearcoat_bump_factor, + uvw: clearcoat_transformed_uvw, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v // true for dx, false for opengl + ) : defaultData; + float3 clearcoat_normal = clearcoat_normal_data.normal; + + + float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal; + float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten); + float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) + : flattened_clearcoat_normal; + + + // ORM Handling // + + float3 ORM_lookup = tex::lookup_float3( + tex: ORM_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + + float3 roughness_lookup = tex::lookup_float3( + tex: reflectionroughness_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x; + float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence); + float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)), + math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y))); + + float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)), + math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y))); + + // Diffuse Color Lookup and AO // + + base::texture_return base_lookup = base::file_texture( + texture: diffuse_texture, + color_offset: color(albedo_add), + color_scale: color(albedo_brightness), + mono_source: base::mono_luminance, + uvw: transformed_uvw, + clip: false + ); + + base::texture_return ao_lookup = base::file_texture( + texture: ao_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ); + + + color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint; + color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation); + color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant; + color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint; + + color base_color = multiply_colors( + color_1: tinted_diffuse, + color_2: ao_color, + weight: ao_to_diffuse + ).tint; + + + // Metalness // + + float3 metallic_lookup = tex::lookup_float3( + tex: metallic_texture, + coord: float2(transformed_uvw.position.x, transformed_uvw.position.y) + ); + + float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x; + float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence); + + + // Emission // + + color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ? + base::file_texture( + texture: emissive_color_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : emissive_color; + + color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ? + base::file_texture( + texture: emissive_mask_texture, + color_offset: color(0.0, 0.0, 0.0), + color_scale: color(1.0, 1.0, 1.0), + mono_source: base::mono_average, + uvw: transformed_uvw, + clip: false + ).tint : color(1.0); + + color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0); + + // Opacity // + + float opacity_value = enable_opacity_texture ? base::file_texture( + texture: opacity_texture, + mono_source: opacity_mode, + uvw: transformed_uvw + ).mono : opacity_constant; + + float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0; + + material base = OmniPBRBase::OmniPBRBase( + diffuse_reflection_color: base_color, + specular_reflection_aniso_roughness: reflection_roughness, + specular_level: specular_level, + metalness: metallic, + enable_emission: enable_emission, + emission_color: final_emission_color, + emission_intensity: emissive_intensity, + enable_coat: enable_clearcoat, + coat_weight: clearcoat_weight, + coat_color: clearcoat_tint, + coat_transparency: clearcoat_transparency, + coat_aniso_roughness: clearcoat_reflection_roughness2, + coat_ior: clearcoat_ior, + enable_opacity: enable_opacity, + geometry_opacity: cutout_opacity, + clearcoat_geometry_normal: final_clearcoat_normal, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials, + geometry_normal: diffuse_gloss_normal + ); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/unitree_z1/materials/mdl/OmniSurface.mdl b/unitree_z1/materials/mdl/OmniSurface.mdl new file mode 100644 index 0000000000000000000000000000000000000000..64efda62f260375b0096521d12cfe79fb08a93b7 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface.mdl @@ -0,0 +1,1693 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +// Wrapper for OmniSurfaceBase material + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::limits::*; +import ::state::*; +import ::tex::*; + +import OmniSurface::OmniSurfaceBase::*; +import OmniSurface::OmniShared::*; +import OmniSurface::OmniImage::*; + +export material OmniSurface( + + //Diffuse reflection + // + float diffuse_reflection_weight = float(0.8) [[ + anno::display_name("Weight"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d diffuse_reflection_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Base"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode diffuse_reflection_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Base") + ]], + + color diffuse_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Base") + ]], + + uniform texture_2d diffuse_reflection_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Base") + ]], + + float diffuse_reflection_roughness = float(0.0) [[ + anno::display_name("Diffuse Roughness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d diffuse_reflection_roughness_image = texture_2d() [[ + anno::display_name("Diffuse Roughness Image"), + anno::in_group("Base"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode diffuse_reflection_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Diffuse Roughness Alpha Mode"), + anno::in_group("Base") + ]], + + //Metal + // + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d metalness_image = texture_2d() [[ + anno::display_name("Metalness Image"), + anno::in_group("Base"), + anno::usage("metalness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode metalness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Metalness Image Alpha Mode"), + anno::in_group("Base") + ]], + + //Specular reflection + // + float specular_reflection_weight = float(1.0) [[ + anno::display_name("Weight"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Specular"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Specular") + ]], + + color specular_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Specular") + ]], + + uniform texture_2d specular_reflection_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Specular") + ]], + + float specular_reflection_roughness = float(0.2) [[ + anno::display_name("Roughness"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_roughness_image = texture_2d() [[ + anno::display_name("Roughness Image"), + anno::in_group("Specular"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Roughness Image Alpha Mode"), + anno::in_group("Specular") + ]], + + uniform OmniSurface::OmniShared::ior_presets specular_reflection_ior_preset = + OmniSurface::OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Specular") + ]], + + uniform float specular_reflection_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Specular"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float specular_reflection_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_anisotropy_image = texture_2d() [[ + anno::display_name("Anisotropy Image"), + anno::in_group("Specular"), + anno::usage("anisotropy") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Image Alpha Mode"), + anno::in_group("Specular") + ]], + + float specular_reflection_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Specular"), + anno::soft_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_anisotropy_rotation_image = texture_2d() [[ + anno::display_name("Anisotropy Rotation Image"), + anno::in_group("Specular"), + anno::usage("anisotropy_rotation") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_rotation_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Rotation Alpha Mode"), + anno::in_group("Specular") + ]], + + //Specular transmission + // + uniform bool enable_specular_transmission = false [[ + anno::display_name("Enable Transmission"), + anno::description("Enables the use of transmission"), + anno::in_group("Transmission") + ]], + + float specular_transmission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_transmission_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Transmission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_transmission_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Transmission") + ]], + + color specular_transmission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Transmission") + ]], + + uniform texture_2d specular_transmission_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Transmission") + ]], + + float specular_transmission_scattering_depth = float(0.0) [[ + anno::display_name("Depth"), + anno::in_group("Transmission"), + anno::soft_range(0.0f, 100.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + uniform texture_2d specular_transmission_scattering_depth_image = texture_2d() [[ + anno::display_name("Depth Image"), + anno::in_group("Transmission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_transmission_scattering_depth_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Depth Image Alpha Mode"), + anno::in_group("Transmission") + ]], + + color specular_transmission_scattering_color = color(0.0) [[ + anno::display_name("Scatter"), + anno::in_group("Transmission") + ]], + + uniform texture_2d specular_transmission_scattering_color_image = texture_2d() [[ + anno::display_name("Scatter Image"), + anno::in_group("Transmission") + ]], + + float specular_transmission_scatter_anisotropy = float(0.0) [[ + anno::display_name("Scatter Anisotropy"), + anno::in_group("Transmission"), + anno::hard_range(-1.0f, 1.0f) + ]], + + uniform texture_2d specular_transmission_scatter_anisotropy_image = texture_2d() [[ + anno::display_name("Scatter Anisotropy Image"), + anno::in_group("Transmission") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_transmission_scatter_anisotropy_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Scatter Anisotropy Image Alpha Mode"), + anno::in_group("Transmission") + ]], + + uniform float specular_transmission_dispersion_abbe = float(0.0) [[ + anno::display_name("Dispersion Abbe"), + anno::in_group("Transmission"), + anno::soft_range(0.0f, 100.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + //Subsurface + // + uniform bool enable_diffuse_transmission = false [[ + anno::display_name("Enable Subsurface"), + anno::description("Enables the use of subsurface"), + anno::in_group("Subsurface") + ]], + + float subsurface_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Subsurface"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d subsurface_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Subsurface"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode subsurface_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Subsurface") + ]], + + uniform OmniSurface::OmniShared::scattering_colors_presets subsurface_scattering_colors_preset = + OmniSurface::OmniShared::scattering_colors_custom [[ + anno::display_name("Scattering Presets"), + anno::in_group("Subsurface") + ]], + + color subsurface_transmission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Subsurface") + ]], + + uniform texture_2d subsurface_transmission_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Subsurface") + ]], + + color subsurface_scattering_color = color(1.0) [[ + anno::display_name("Radius (mfp)"), + anno::in_group("Subsurface") + ]], + + uniform texture_2d subsurface_scattering_color_image = texture_2d() [[ + anno::display_name("Radius Image"), + anno::in_group("Subsurface") + ]], + + float subsurface_scale = float(1.0) [[ + anno::display_name("Scale"), + anno::in_group("Subsurface"), + anno::soft_range(0.0f, 10.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + uniform texture_2d subsurface_scale_image = texture_2d() [[ + anno::display_name("Scale Image"), + anno::in_group("Subsurface"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode subsurface_scale_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Scale Image Alpha Mode"), + anno::in_group("Subsurface") + ]], + + float subsurface_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Subsurface"), + anno::hard_range(-1.0f, 1.0f) + ]], + + uniform texture_2d subsurface_anisotropy_image = texture_2d() [[ + anno::display_name("Anisotropy Image"), + anno::in_group("Subsurface"), + anno::usage("anisotropy") + ]], + + uniform OmniSurface::OmniImage::alpha_mode subsurface_anisotropy_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Image Alpha Mode"), + anno::in_group("Subsurface") + ]], + + //Coat + // + float coat_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Coat"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Coat") + ]], + + color coat_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Coat") + ]], + + uniform texture_2d coat_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Coat") + ]], + + float coat_roughness = float(0.1) [[ + anno::display_name("Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_roughness_image = texture_2d() [[ + anno::display_name("Roughness Image"), + anno::in_group("Coat"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Roughness Image Alpha Mode"), + anno::in_group("Coat") + ]], + + uniform OmniSurface::OmniShared::ior_presets coat_ior_preset = + OmniSurface::OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Coat") + ]], + + uniform float coat_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Coat"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float coat_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_anisotropy_image = texture_2d() [[ + anno::display_name("Anisotropy Image"), + anno::in_group("Coat"), + anno::usage("anisotropy") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_anisotropy_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Image Alpha Mode"), + anno::in_group("Coat") + ]], + + float coat_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Coat"), + anno::soft_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_anisotropy_rotation_image = texture_2d() [[ + anno::display_name("Anisotropy Rotation Image"), + anno::in_group("Coat"), + anno::usage("anisotropy_rotation") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_anisotropy_rotation_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Rotation Image Alpha Mode"), + anno::in_group("Coat") + ]], + + float coat_affect_color = float(0.0) [[ + anno::display_name("Affect Color"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_affect_color_image = texture_2d() [[ + anno::display_name("Affect Color Image"), + anno::in_group("Coat") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_affect_color_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Affect Color Image Alpha Mode"), + anno::in_group("Coat") + ]], + + float coat_affect_roughness = float(0.0) [[ + anno::display_name("Affect Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_affect_roughness_image = texture_2d() [[ + anno::display_name("Affect Roughness Image"), + anno::in_group("Coat"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_affect_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Affect Roughness Alpha Mode"), + anno::in_group("Coat") + ]], + + uniform float coat_normal_strength = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::in_group("Coat"), + anno::soft_range(0.0f, 1.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float3 coat_normal = state::normal() [[ + anno::display_name("Normal"), + anno::in_group("Coat"), + anno::usage("normal") + ]], + + uniform texture_2d coat_normal_image = texture_2d() [[ + anno::display_name("Normal Map Image"), + anno::in_group("Coat"), + anno::usage("normal") + ]], + + uniform bool coat_normal_image_flip_r_channel = false [[ + anno::display_name("Normal Map Flip R Channel"), + anno::in_group("Coat") + ]], + + uniform bool coat_normal_image_flip_g_channel = false [[ + anno::display_name("Normal Map Flip G Channel"), + anno::in_group("Coat") + ]], + + uniform bool coat_normal_image_flip_b_channel = false [[ + anno::display_name("Normal Map Flip B Channel"), + anno::in_group("Coat") + ]], + + //Specular retro-reflection + // + float specular_retro_reflection_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Sheen"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_retro_reflection_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Sheen"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_retro_reflection_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Sheen") + ]], + + color specular_retro_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Sheen") + ]], + + uniform texture_2d specular_retro_reflection_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Sheen") + ]], + + float specular_retro_reflection_roughness = float(0.3) [[ + anno::display_name("Roughness"), + anno::in_group("Sheen"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_retro_reflection_roughness_image = texture_2d() [[ + anno::display_name("Roughness Image"), + anno::in_group("Sheen"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_retro_reflection_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Roughness Image Alpha Mode"), + anno::in_group("Sheen") + ]], + + //Emission + // + float emission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Emission"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d emission_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Emission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode emission_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Emission") + ]], + + uniform OmniSurface::OmniShared::emission_mode emission_mode = + OmniSurface::OmniShared::emission_lx [[ + anno::display_name("Emission Mode"), + anno::in_group("Emission") + ]], + + float emission_intensity = float(1.0) [[ + anno::display_name("Intensity"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 1000.0f) + ]], + + uniform texture_2d emission_intensity_image = texture_2d() [[ + anno::display_name("Intensity Image"), + anno::in_group("Emission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode emission_intensity_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Intensity Image Alpha Mode"), + anno::in_group("Emission") + ]], + + color emission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Emission") + ]], + + uniform texture_2d emission_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Emission") + ]], + + uniform bool emission_use_temperature = false [[ + anno::display_name("Use Temperature"), + anno::in_group("Emission") + ]], + + float emission_temperature = float(6500.0) [[ + anno::display_name("Temperature (kelvin)"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 10000.0f) + ]], + + uniform texture_2d emission_temperature_image = texture_2d() [[ + anno::display_name("Temperature Image"), + anno::in_group("Emission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode emission_temperature_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Temperature Image Alpha Mode"), + anno::in_group("Emission") + ]], + + //Thin Film + // + uniform bool enable_thin_film = false [[ + anno::display_name("Enable Thin Film"), + anno::description("Enable the use of thin film"), + anno::in_group("Thin Film") + ]], + + float thin_film_thickness = float(400.0) [[ + anno::display_name("Thickness (nm)"), + anno::in_group("Thin Film"), + anno::soft_range(0.0f, 2000.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + uniform texture_2d thin_film_thickness_image = texture_2d() [[ + anno::display_name("Thickness Image"), + anno::in_group("Thin Film"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode thin_film_thickness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Thickness Image Alpha Mode"), + anno::in_group("Thin Film") + ]], + + uniform OmniSurface::OmniShared::ior_presets thin_film_ior_preset = + OmniSurface::OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Thin Film") + ]], + + uniform float thin_film_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Thin Film"), + anno::soft_range(1.0f, 3.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + //Geometry + // + uniform bool thin_walled = false [[ + anno::display_name("Thin Walled"), + anno::description("Thin surface with no interior."), + anno::in_group("Geometry") + ]], + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Geometry") + ]], + + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d geometry_opacity_image = texture_2d() [[ + anno::display_name("Opacity Image"), + anno::in_group("Geometry"), + anno::usage("opacity") + ]], + + uniform OmniSurface::OmniImage::alpha_mode geometry_opacity_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Opacity Image Alpha Mode"), + anno::in_group("Geometry") + ]], + + uniform float geometry_opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + + uniform float geometry_normal_strength = float(1.0) [[ + anno::display_name("Geometry Normal Strength"), + anno::in_group("Geometry"), + anno::soft_range(0.0f, 1.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + uniform float geometry_normal_roughness_strength = float(1.0) [[ + anno::display_name("Geometry Normal Roughness Strength"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + uniform texture_2d geometry_normal_image = texture_2d() [[ + anno::display_name("Geometry Normal Map Image"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + uniform bool geometry_normal_image_flip_r_channel = false [[ + anno::display_name("Normal Map Flip R Channel"), + anno::in_group("Geometry") + ]], + + uniform bool geometry_normal_image_flip_g_channel = false [[ + anno::display_name("Normal Map Flip G Channel"), + anno::in_group("Geometry") + ]], + + uniform bool geometry_normal_image_flip_b_channel = false [[ + anno::display_name("Normal Map Flip B Channel"), + anno::in_group("Geometry") + ]], + + uniform OmniSurface::OmniImage::tangent_bitangent_mapping geometry_tangent_bitangent_mapping = + OmniSurface::OmniImage::red_green [[ + anno::display_name("Tangent Bitangent Mapping"), + anno::in_group("Geometry") + ]], + + //Displacement + float3 geometry_displacement = float3(0.0) [[ + anno::display_name("Displacement"), + anno::in_group("Geometry") + ]], + + uniform OmniSurface::OmniShared::displacement_mode geometry_displacement_mode = + OmniSurface::OmniShared::displacement_height [[ + anno::display_name("Displacement Mode"), + anno::in_group("Geometry") + ]], + + uniform texture_2d geometry_displacement_image = texture_2d() [[ + anno::display_name("Displacement Image"), + anno::in_group("Geometry"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode geometry_displacement_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Displacement Image Alpha Mode"), + anno::in_group("Geometry") + ]], + + float geometry_displacement_scale = float(1.0) [[ + anno::display_name("Displacement Scale"), + anno::in_group("Geometry"), + anno::soft_range(0.0f, 1.0f) + ]], + + uniform texture_2d geometry_displacement_scale_image = texture_2d() [[ + anno::display_name("Displacement Scale Image"), + anno::in_group("Geometry"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode geometry_displacement_scale_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Displacement Scale Image Alpha Mode"), + anno::in_group("Geometry") + ]], + + float geometry_displacement_scalar_zero_value = float(0.0) [[ + anno::display_name("Displacement Scalar Zero Value"), + anno::in_group("Geometry"), + anno::soft_range(0.0f, 1.0f) + ]], + + //UVW + // + uniform base::texture_coordinate_system uvw_texture_coordinate_system = + base::texture_coordinate_uvw [[ + anno::display_name("Texture Coordinate"), + anno::in_group("UVW Coordinates") + ]], + + uniform int uvw_uv_set = 0 [[ + anno::display_name("UV Set"), + anno::in_group("UVW Coordinates"), + anno::hard_range(0, 4) + ]], + + uniform bool uvw_ignore_missing_textures = false [[ + anno::display_name("Ignore Missing Images"), + anno::in_group("UVW Coordinates") + ]], + + color uvw_missing_texture_color = color(0.0, 0.0, 0.0) [[ + anno::display_name("Missing Image Color"), + anno::in_group("UVW Coordinates") + ]], + + uniform bool uvw_use_uv_coords = false [[ + anno::display_name("Use UV Coords"), + anno::in_group("UVW Coordinates") + ]], + + float2 uvw_uv_coords = float2(0.0) [[ + anno::display_name("UV Coords"), + anno::in_group("UVW Coordinates") + ]], + + uniform float uvw_s_offset = 0.0f [[ + anno::display_name("Offset U"), + anno::in_group("UVW Coordinates"), + anno::soft_range(-1.0f, 1.0f) + ]], + + uniform float uvw_t_offset = 0.0f [[ + anno::display_name("Offset V"), + anno::in_group("UVW Coordinates"), + anno::soft_range(-1.0f, 1.0f) + ]], + + uniform OmniSurface::OmniImage::wrap_mode uvw_s_wrap = + OmniSurface::OmniImage::wrap_periodic [[ + anno::display_name("Wrap U"), + anno::in_group("UVW Coordinates") + ]], + + uniform OmniSurface::OmniImage::wrap_mode uvw_t_wrap = + OmniSurface::OmniImage::wrap_periodic [[ + anno::display_name("Wrap V"), + anno::in_group("UVW Coordinates") + ]], + + uniform float uvw_s_scale = 1.0f [[ + anno::display_name("Scale U"), + anno::in_group("UVW Coordinates"), + anno::soft_range(0.0f, 100.0f) + ]], + + uniform float uvw_t_scale = 1.0f [[ + anno::display_name("Scale V"), + anno::in_group("UVW Coordinates"), + anno::soft_range(0.0f, 100.0f) + ]], + + uniform bool uvw_s_flip = false [[ + anno::display_name("Flip U"), + anno::in_group("UVW Coordinates") + ]], + + uniform bool uvw_t_flip = false [[ + anno::display_name("Flip V"), + anno::in_group("UVW Coordinates") + ]], + + uniform bool uvw_swap_st = false [[ + anno::display_name("Swap UV"), + anno::in_group("UVW Coordinates") + ]], + + //Projection Coordinates (Local / World) + uniform OmniSurface::OmniImage::projection_mode uvw_projection_mode = + OmniSurface::OmniImage::projection_cubic [[ + anno::display_name("Projection Mode"), + anno::in_group("UVW Coordinates") + ]], + + uniform float3 uvw_projection_translate = float3(0.0) [[ + anno::display_name("Translate"), + anno::description("Translate the projected texture."), + anno::in_group("UVW Coordinates") + ]], + + uniform float3 uvw_projection_rotate = float3(0.0) [[ + anno::display_name("Rotate"), + anno::description("Rotate the projected texture."), + anno::in_group("UVW Coordinates") + ]], + + uniform float3 uvw_projection_scale = float3(1.0) [[ + anno::display_name("Scale"), + anno::description("Scale the projected texture."), + anno::in_group("UVW Coordinates") + ]] +) +[[ + anno::display_name("OmniSurface"), + anno::description("A base material for modeling a variety of surfaces."), + anno::author("NVIDIA Corporation"), + anno::key_words(string[]("generic", "surface")), + anno::version(1, 0, 0, ""), + anno::in_group("Advanced") +]] = let { + + base::texture_coordinate_info texture_coordinate_info = + OmniSurface::OmniImage::compute_texture_coordinate_2( + uvw_texture_coordinate_system, + uvw_uv_set, + uvw_s_offset, + uvw_t_offset, + uvw_s_scale, + uvw_t_scale, + uvw_s_flip, + uvw_t_flip, + uvw_swap_st, + uvw_projection_mode, + uvw_projection_translate, + uvw_projection_rotate, + uvw_projection_scale); + + OmniSurface::OmniImage::normal_roughness_data geometry_normal_roughness_data = + tex::texture_isvalid(geometry_normal_image) ? + OmniSurface::OmniImage::tangent_space_normal_roughness_lookup_2( + geometry_normal_image, + uvw_ignore_missing_textures, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + uvw_s_flip, + uvw_t_flip, + geometry_normal_strength, + geometry_normal_image_flip_r_channel, + geometry_normal_image_flip_g_channel, + geometry_normal_image_flip_b_channel, + texture_coordinate_info + ) : + OmniSurface::OmniImage::normal_roughness_data(geometry_normal, float2(0.0)); + + material base = OmniSurface::OmniSurfaceBase::OmniSurfaceBase( + + //Base + // + diffuse_reflection_weight: tex::texture_isvalid(diffuse_reflection_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + diffuse_reflection_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + diffuse_reflection_weight_image_alpha_mode + ).mono : + diffuse_reflection_weight, + + diffuse_reflection_color: tex::texture_isvalid(diffuse_reflection_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + diffuse_reflection_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + diffuse_reflection_color, + + diffuse_reflection_roughness: tex::texture_isvalid(diffuse_reflection_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + diffuse_reflection_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + diffuse_reflection_roughness_image_alpha_mode + ).mono : + diffuse_reflection_roughness, + + //Metalness + // + metalness: tex::texture_isvalid(metalness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + metalness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + metalness_image_alpha_mode + ).mono : + metalness, + + //Specular reflection + // + specular_reflection_weight: tex::texture_isvalid(specular_reflection_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_weight_image_alpha_mode + ).mono : + specular_reflection_weight, + + specular_reflection_color: tex::texture_isvalid(specular_reflection_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + specular_reflection_color, + + specular_reflection_roughness: tex::texture_isvalid(specular_reflection_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_roughness_image_alpha_mode + ).mono : + specular_reflection_roughness, + + specular_reflection_ior_preset: specular_reflection_ior_preset, + specular_reflection_ior: specular_reflection_ior, + + specular_reflection_anisotropy: tex::texture_isvalid(specular_reflection_anisotropy_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_anisotropy_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_anisotropy_image_alpha_mode + ).mono : + specular_reflection_anisotropy, + + specular_reflection_anisotropy_rotation: tex::texture_isvalid(specular_reflection_anisotropy_rotation_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_anisotropy_rotation_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_anisotropy_rotation_image_alpha_mode + ).mono : + specular_reflection_anisotropy_rotation, + + //Specular transmission + // + enable_specular_transmission: enable_specular_transmission, + + specular_transmission_weight: tex::texture_isvalid(specular_transmission_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_transmission_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_transmission_weight_image_alpha_mode + ).mono : + specular_transmission_weight, + + specular_transmission_color: tex::texture_isvalid(specular_transmission_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + specular_transmission_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + specular_transmission_color, + + specular_transmission_scattering_depth: tex::texture_isvalid(specular_transmission_scattering_depth_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_transmission_scattering_depth_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_transmission_scattering_depth_image_alpha_mode + ).mono : + specular_transmission_scattering_depth, + + specular_transmission_scattering_color: tex::texture_isvalid(specular_transmission_scattering_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + specular_transmission_scattering_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + specular_transmission_scattering_color, + + specular_transmission_scatter_anisotropy: tex::texture_isvalid(specular_transmission_scatter_anisotropy_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_transmission_scatter_anisotropy_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_transmission_scatter_anisotropy_image_alpha_mode + ).mono : + specular_transmission_scatter_anisotropy, + + specular_transmission_dispersion_abbe: specular_transmission_dispersion_abbe, + + //Subsurface + // + enable_diffuse_transmission: enable_diffuse_transmission, + + subsurface_weight: tex::texture_isvalid(subsurface_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + subsurface_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + subsurface_weight_image_alpha_mode + ).mono : + subsurface_weight, + + subsurface_scattering_colors_preset: subsurface_scattering_colors_preset, + + subsurface_transmission_color: tex::texture_isvalid(subsurface_transmission_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + subsurface_transmission_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + subsurface_transmission_color, + + subsurface_scattering_color: tex::texture_isvalid(subsurface_scattering_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + subsurface_scattering_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + subsurface_scattering_color, + + subsurface_scale: tex::texture_isvalid(subsurface_scale_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + subsurface_scale_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + subsurface_scale_image_alpha_mode + ).mono : + subsurface_scale, + + subsurface_anisotropy: tex::texture_isvalid(subsurface_anisotropy_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + subsurface_anisotropy_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + subsurface_anisotropy_image_alpha_mode + ).mono : + subsurface_anisotropy, + + //Coat + // + coat_weight: tex::texture_isvalid(coat_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_weight_image_alpha_mode + ).mono : + coat_weight, + + coat_color: tex::texture_isvalid(coat_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + coat_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + coat_color, + + coat_roughness: tex::texture_isvalid(coat_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_roughness_image_alpha_mode + ).mono : + coat_roughness, + + coat_ior_preset: coat_ior_preset, + coat_ior: coat_ior, + + coat_anisotropy: tex::texture_isvalid(coat_anisotropy_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_anisotropy_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_anisotropy_image_alpha_mode + ).mono : + coat_anisotropy, + + coat_anisotropy_rotation: tex::texture_isvalid(coat_anisotropy_rotation_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_anisotropy_rotation_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_anisotropy_rotation_image_alpha_mode + ).mono : + coat_anisotropy_rotation, + + coat_affect_color: tex::texture_isvalid(coat_affect_color_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_affect_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_affect_color_image_alpha_mode + ).mono : + coat_affect_color, + + coat_affect_roughness: tex::texture_isvalid(coat_affect_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_affect_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_affect_roughness_image_alpha_mode + ).mono : + coat_affect_roughness, + + coat_normal: tex::texture_isvalid(coat_normal_image) ? + OmniSurface::OmniImage::normal_mapping( + OmniSurface::OmniImage::tangent_space_normal_lookup_2( + coat_normal_image, + uvw_ignore_missing_textures, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + uvw_s_flip, + uvw_t_flip, + coat_normal_strength, + coat_normal_image_flip_r_channel, + coat_normal_image_flip_g_channel, + coat_normal_image_flip_b_channel, + texture_coordinate_info + ), + geometry_tangent_bitangent_mapping, + coat_normal + ): + coat_normal, + + //Specular retro reflection + // + specular_retro_reflection_weight: tex::texture_isvalid(specular_retro_reflection_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_retro_reflection_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_retro_reflection_weight_image_alpha_mode + ).mono : + specular_retro_reflection_weight, + + specular_retro_reflection_color: tex::texture_isvalid(specular_retro_reflection_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + specular_retro_reflection_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + specular_retro_reflection_color, + + specular_retro_reflection_roughness: tex::texture_isvalid(specular_retro_reflection_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_retro_reflection_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_retro_reflection_roughness_image_alpha_mode + ).mono : + specular_retro_reflection_roughness, + + //Emission + // + emission_weight: tex::texture_isvalid(emission_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + emission_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + emission_weight_image_alpha_mode + ).mono : + emission_weight, + + emission_mode: emission_mode, + + emission_intensity: tex::texture_isvalid(emission_intensity_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + emission_intensity_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + emission_intensity_image_alpha_mode + ).mono : + emission_intensity, + + emission_color: tex::texture_isvalid(emission_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + emission_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + emission_color, + + emission_use_temperature: emission_use_temperature, + + emission_temperature: tex::texture_isvalid(emission_temperature_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + emission_temperature_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + emission_temperature_image_alpha_mode + ).mono : + emission_temperature, + + //Thin Film + // + enable_thin_film: enable_thin_film, + + thin_film_thickness: tex::texture_isvalid(thin_film_thickness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + thin_film_thickness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + thin_film_thickness_image_alpha_mode + ).mono : + thin_film_thickness, + + thin_film_ior_preset: thin_film_ior_preset, + thin_film_ior: thin_film_ior, + + //Geometry + // + thin_walled: thin_walled, + + enable_opacity: enable_opacity, + + geometry_opacity: tex::texture_isvalid(geometry_opacity_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + geometry_opacity_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + geometry_opacity_image_alpha_mode + ).mono : + geometry_opacity, + + geometry_opacity_threshold: geometry_opacity_threshold, + + round_edges_radius: round_edges_radius, + + round_edges_roundness: round_edges_roundness, + + round_edges_across_materials: round_edges_across_materials, + + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + + geometry_normal_roughness: geometry_normal_roughness_data.roughness, + + geometry_normal: OmniSurface::OmniImage::normal_mapping( + geometry_normal_roughness_data.normal, + geometry_tangent_bitangent_mapping, + geometry_normal), + + geometry_displacement: tex::texture_isvalid(geometry_displacement_image) ? + OmniSurface::OmniShared::displacement_adjustment( + (geometry_displacement_mode == OmniSurface::OmniShared::displacement_height) ? + float3(OmniSurface::OmniImage::texture_adjustment_2( + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + geometry_displacement_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + geometry_displacement_image_alpha_mode + ), + 0.0f, //exposure + color(0.5), //default_color + color(1.0), //color_gain + color(0.0), //color_offset + 1.0f, //alpha_gain + -1.0f * geometry_displacement_scalar_zero_value, //alpha_offset + false, //invert + 0.0f //blend_factor + ).mono) : + + float3(OmniSurface::OmniImage::texture_lookup_2( + geometry_displacement_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint + ), + + geometry_displacement_mode, + + tex::texture_isvalid(geometry_displacement_scale_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + geometry_displacement_scale_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + geometry_displacement_scale_image_alpha_mode + ).mono : + geometry_displacement_scale + ): + geometry_displacement + ); + +} in material( + thin_walled: base.thin_walled, + ior: base.ior, + surface: base.surface, + backface: base.backface, + volume: base.volume, + geometry: base.geometry +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniHairBase.png b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniHairBase.png new file mode 100644 index 0000000000000000000000000000000000000000..ebb7328cc325ed135bc46b9e88970bc4cec0c008 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniHairBase.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c199f719bb31cdc60ff9b8e1d3b206be699d98b6c57e178ecf03abe29918f84 +size 38058 diff --git a/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceBase.png b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceBase.png new file mode 100644 index 0000000000000000000000000000000000000000..d021b14dd32226974e8227a0992cf0afcd57a76f --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceBase.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98778cb33e32234e304c918a3dd5299b550ad1d84d6811aac6e59a69ea61883c +size 67332 diff --git a/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceBlendBase.png b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceBlendBase.png new file mode 100644 index 0000000000000000000000000000000000000000..20c5133542bfb0c10d7196875e874e8c64cd635a --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceBlendBase.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:650831bc8c7d44733ea3124d97537c9629e1c99b4637f5495d773b037a67666e +size 93920 diff --git a/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceLiteBase.png b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceLiteBase.png new file mode 100644 index 0000000000000000000000000000000000000000..491918a1c82be69056175ac077d4b1ae38ccf3d9 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/.thumbs/OmniSurfaceLiteBase.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3786412c4aaf7366af3d41a0f4d4227b6978b6f89ea8c5d92150dcd67325158 +size 63206 diff --git a/unitree_z1/materials/mdl/OmniSurface/OmniHairBase.mdl b/unitree_z1/materials/mdl/OmniSurface/OmniHairBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8ff2b5612ef78c3894e95541a8151e840d81369f --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/OmniHairBase.mdl @@ -0,0 +1,371 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// Implementation of OmniHairBase material + +mdl 1.7; + +import ::anno::*; +import ::df::*; +import ::limits::*; +import ::math::*; +import ::state::*; + +import OmniShared::*; + +//http://www.eugenedeon.com/wp-content/uploads/2014/04/egsrhair.pdf +color compute_absorption_from_melanin_deon(float eumelanin, float pheomelanin) [[ + anno::unused() +]] +{ + return math::max( + eumelanin * color(0.419, 0.697, 1.37) + pheomelanin * color(0.187, 0.4, 1.05), + color(0.0)); +} + +//https://benedikt-bitterli.me/pchfm/pchfm.pdf +color compute_absorption_from_melanin(float eumelanin, float pheomelanin) +{ + return math::max( + eumelanin * color(0.506, 0.841, 1.653) + pheomelanin * color(0.343, 0.733, 1.924), + color(0.0)); +} + +color compute_absorption_from_color(color c, float betaN) +{ + float betaN2 = betaN * betaN; + float betaN4 = betaN2 * betaN2; + float roughness_fac = + 5.969f - + (0.215f * betaN) + + (2.532f * betaN2) - + (10.73f * betaN2 * betaN) + + (5.574f * betaN4) + + (0.245f * betaN4 * betaN); + + color sigma = math::log(math::min(math::max(c, 0.001f), color(1.0))) / roughness_fac; + return sigma * sigma; +} + +float pow20(float beta) +{ + float beta2 = beta * beta; + float beta4 = beta2 * beta2; + float beta8 = beta4 * beta4; + float beta16 = beta8 * beta8; + float beta20 = beta16 * beta4; + return beta20; +} + +float pow22(float beta) +{ + float beta2 = beta * beta; + float beta4 = beta2 * beta2; + float beta8 = beta4 * beta4; + float beta16 = beta8 * beta8; + float beta22 = beta16 * beta4 * beta2; + return beta22; +} + +//Compute variance logistic scale factor +float compute_v(float betaM) +{ + float tmp = 0.726f * betaM + 0.812f * betaM * betaM + 3.7f * pow20(betaM); + return tmp * tmp; +} + +//Compute azimuthal logistic scale factor +float compute_s(float betaN) +{ + return 0.265f * betaN + 1.194f * betaN * betaN + 5.372f * pow22(betaN); +} + +export material OmniHairBase( + + //Color + // + float base_color_weight = float(1.0) [[ + anno::display_name("Base Color Weight"), + anno::in_group("Color"), + anno::hard_range(0.0f, 1.0f) + ]], + + color base_color = color(1.0) [[ + anno::display_name("Base Color"), + anno::in_group("Color") + ]], + + //Melanin + // + uniform OmniShared::melanin_concentration_presets melanin_concentration_preset = + OmniShared::melanin_concentration_custom [[ + anno::display_name("Melanin Presets"), + anno::in_group("Color") + ]], + + float melanin_concentration = float(1.0) [[ + anno::display_name("Melanin"), + anno::in_group("Color"), + anno::soft_range(0.0f, 1.0f), + anno::hard_range(0.0f, 1.5f) + ]], + + float melanin_redness = float(0.5) [[ + anno::display_name("Melanin Redness (Pheomelanin)"), + anno::in_group("Color"), + anno::soft_range(0.0f, 1.0f) + ]], + + float melanin_concentration_randomize = float(0.0) [[ + anno::display_name("Melanin Randomize"), + anno::in_group("Color"), + anno::unused(), + anno::hard_range(0.0f, 1.0f) + ]], + + //Specular + // + float specular_reflection_roughness = float(0.1) [[ + anno::display_name("Roughness"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform bool specular_reflection_anisotropic_roughness = false [[ + anno::display_name("Anisotropic Roughness"), + anno::in_group("Specular") + ]], + + float specular_reflection_azimuthal_roughness = float(0.2) [[ + anno::display_name("Azimuthal Roughness"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float specular_reflection_ior = float(1.55) [[ + anno::display_name("IOR"), + anno::in_group("Specular"), + anno::soft_range(0.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float specular_reflection_shift = float(3.0) [[ + anno::display_name("Shift (degree)"), + anno::in_group("Specular"), + anno::soft_range(0.0f, 20.0f), + anno::hard_range(-90.0f, 90.0f) + ]], + + //Diffuse Reflection + // + float diffuse_reflection_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Diffuse"), + anno::hard_range(0.0f, 1.0f) + ]], + + color diffuse_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Diffuse") + ]], + + //Emission + // + float emission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Emission"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::emission_mode emission_mode = + OmniShared::emission_lx [[ + anno::display_name("Emission Mode"), + anno::in_group("Emission") + ]], + + float emission_intensity = float(1.0) [[ + anno::display_name("Intensity"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 1000.0f) + ]], + + color emission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Emission") + ]], + + uniform bool emission_use_temperature = false [[ + anno::display_name("Use Temperature"), + anno::in_group("Emission") + ]], + + float emission_temperature = float(6500.0) [[ + anno::display_name("Temperature (kelvin)"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 10000.0f) + ]], + + //Geometry + // + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Geometry") + ]], + + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float geometry_opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + float3 geometry_displacement = float3(0.0) [[ + anno::display_name("Displacement"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniHairBase"), + anno::description("A base material for modeling a variety of hairs, furs, and fibers."), + anno::in_group("Omni Materials"), + anno::author("NVIDIA Corporation"), + anno::key_words(string[]("generic", "hair", "fur", "fiber")), + anno::thumbnail(".thumbs/OmniHairBase.png"), + anno::version(1, 0, 0, "") +]] = let { + + //Emission + uniform float emission_unit_intensity = + (emission_mode == OmniShared::emission_lx) ? + 1.0f : + math::PI; + + color emission_final_color = + emission_use_temperature ? + math::blackbody(emission_temperature): + emission_color; + + color emission_final_intensity = + emission_weight * emission_intensity * emission_unit_intensity * + emission_final_color; + + material_emission emission = material_emission( + emission: df::diffuse_edf(), + intensity: emission_final_intensity, + mode: intensity_radiant_exitance); + + //Surface + material_surface surface = material_surface( + scattering: bsdf(), + emission: emission + ); + + //Back Surface + material_surface back_surface = material_surface( + scattering: bsdf(), + emission: material_emission( + emission: edf(), + intensity: color(0.0), + mode: intensity_radiant_exitance + ) + ); + + //Geometry + material_geometry geometry = material_geometry( + displacement: geometry_displacement, + cutout_opacity: enable_opacity ? + geometry_opacity_threshold == 0.0f ? + geometry_opacity : + (geometry_opacity >= geometry_opacity_threshold ? 1.0f : 0.0f) : + 1.0f, + normal: geometry_normal + ); + + //Melanin Concentration + float melanin_concentration_value = + OmniShared::melanin_concentration_preset_to_value( + melanin_concentration_preset, + melanin_concentration); + + //! \todo: We should pass hair id. + //float random_id = 1.0f; + //float melanin_concentration_randomized_by_id = + // 2.0f * (random_id - 0.5) * melanin_concentration_randomize + 1.0f; + // + float melanin_gamma = 2.4f; + float melanin = melanin_concentration_value * melanin_concentration_value * melanin_gamma; + float eumelanin = melanin * (1.0f - melanin_redness); + float pheomelanin = melanin * melanin_redness; + color melanin_sigma_a = compute_absorption_from_melanin(eumelanin, pheomelanin); + + //Specular Reflection + float longitudinal_roughness = compute_v(specular_reflection_roughness); + + float azimuthal_roughness = + specular_reflection_anisotropic_roughness ? + compute_s(specular_reflection_azimuthal_roughness) : + longitudinal_roughness; + + float2 roughness_r = float2(longitudinal_roughness, azimuthal_roughness); + + float2 roughness_tt_multi = float2(0.6, 0.8); //based on heuristic + float2 roughness_tt = roughness_r * roughness_tt_multi; + + float2 roughness_trt_multi = float2(1.5); //based on heuristic + float2 roughness_trt = roughness_r * roughness_trt_multi; + + float cuticle_angle_in_radian = specular_reflection_shift * -0.0174533f; + + //Base Color + color base_color_sigma_a = + compute_absorption_from_color( + base_color * base_color_weight * melanin_gamma, + specular_reflection_anisotropic_roughness ? + specular_reflection_azimuthal_roughness : + longitudinal_roughness + ); + + color absorption_coefficient = + base_color == color(1.0) && base_color_weight == 1.0f ? + melanin_sigma_a : + math::lerp( + base_color_sigma_a, + melanin_sigma_a, + math::sqrt(melanin_concentration_value) + ); + + hair_bsdf hair = df::chiang_hair_bsdf( + diffuse_reflection_weight: diffuse_reflection_weight, + diffuse_reflection_tint: diffuse_reflection_color, + roughness_R: roughness_r, + roughness_TT: roughness_tt, + roughness_TRT: roughness_trt, + cuticle_angle: cuticle_angle_in_radian, + absorption_coefficient: absorption_coefficient, + ior: math::max(specular_reflection_ior, 1.0f + 1.e-5)); + +} in material( + thin_walled: true, + ior: color(1.0), + surface: surface, + backface: back_surface, + volume: material_volume(), + geometry: geometry, + hair: hair +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurface/OmniImage.mdl b/unitree_z1/materials/mdl/OmniSurface/OmniImage.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4edede4601ca5451d1f27033e4ae72c3d313176d --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/OmniImage.mdl @@ -0,0 +1,901 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +// OmniSurface image lookup utilities + +mdl 1.7; + +import ::df::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::tex::*; +import ::limits::*; +import ::anno::*; +using ::nvidia::support_definitions import rotate_around_x; +using ::nvidia::support_definitions import rotate_around_y; +using ::nvidia::support_definitions import rotate_around_z; + + +export enum wrap_mode +[[ + anno::description("Wrap mode") +]] +{ + wrap_periodic = 0 [[ + anno::display_name("Periodic") + ]], + + wrap_black = 1 [[ + anno::display_name("Black") + ]], + + wrap_clamp = 2 [[ + anno::display_name("Clamp") + ]], + + wrap_mirror = 3 [[ + anno::display_name("Mirror") + ]], + + wrap_file = 4 [[ + anno::display_name("File") + ]], + + wrap_missing = 5 [[ + anno::display_name("Missing") + ]] +}; + + +export enum alpha_mode +[[ + anno::description("Alpha mode") +]] +{ + alpha_default = 0 [[ + anno::display_name("Default") + ]], + + alpha_red = 1 [[ + anno::display_name("Red") + ]], + + alpha_green = 2 [[ + anno::display_name("Green") + ]], + + alpha_blue = 3 [[ + anno::display_name("Blue") + ]], + + alpha_white = 4 [[ + anno::display_name("White") + ]], + + alpha_black = 5 [[ + anno::display_name("Black") + ]], + + alpha_luminance = 6 [[ + anno::display_name("Luminance") + ]], + + alpha_average = 7 [[ + anno::display_name("Average") + ]] +}; + + +export enum tangent_bitangent_mapping +[[ + anno::description("Tangent and bitangent mapping mode") +]] +{ + red_green = 1 [[ + anno::display_name("Red Green") + ]], + + blue_green = 9 [[ + anno::display_name("Red Blue") + ]] +}; + + +export enum projection_mode +[[ + anno::description("Methods for texture projection") +]] +{ + projection_cubic = 1 [[ + anno::display_name("Cubic") + ]], + + projection_spherical = 2 [[ + anno::display_name("Spherical") + ]], + + projection_cylindrical = 3 [[ + anno::display_name("Cylindrical") + ]], + + projection_infinite_cylindrical = 4 [[ + anno::display_name("Cylindrical") + ]], + + projection_planar = 5 [[ + anno::display_name("Planar") + ]], + + projection_spherical_normalized = 6 [[ + anno::display_name("Spherical Normalized") + ]], + + projection_cylindrical_normalized = 7 [[ + anno::display_name("Cylindrical Normalized") + ]], + + projection_infinite_cylindrical_normalized = 8 [[ + anno::display_name("Infinite Cylindrical Normalized") + ]], + + projection_tri_planar = 9 [[ + anno::display_name("Tri-Planar") + ]], + + projection_latitude_longitude = 10 [[ + anno::display_name("Latitude Longitude") + ]] +}; + + +export base::projection_mode to_native_projection_mode(uniform projection_mode mode) +{ + base::projection_mode native_projection_mode; + switch (mode) + { + case projection_cubic: + native_projection_mode = base::projection_cubic; + break; + + case projection_spherical: + native_projection_mode = base::projection_spherical; + break; + + case projection_cylindrical: + native_projection_mode = base::projection_cylindrical; + break; + + case projection_infinite_cylindrical: + native_projection_mode = base::projection_infinite_cylindrical; + break; + + case projection_planar: + native_projection_mode = base::projection_planar; + break; + + case projection_spherical_normalized: + native_projection_mode = base::projection_spherical_normalized; + break; + + case projection_cylindrical_normalized: + native_projection_mode = base::projection_cylindrical_normalized; + break; + + case projection_infinite_cylindrical_normalized: + native_projection_mode = base::projection_infinite_cylindrical_normalized; + break; + + case projection_tri_planar: + native_projection_mode = base::projection_tri_planar; + break; + + default: //planner + native_projection_mode = base::projection_planar; + break; + } + + return native_projection_mode; +} + + +float2 xyz_to_uv(float3 p) +{ + p = math::normalize(p); + return float2( + math::atan2(p.x, -p.z) / math::acos(-1.0) * 0.5 + 0.5, + math::asin(-p.y) / math::acos(-1.0) + 0.5); +} + + +export float3 compute_latitude_longitude_projection( + float3 pos, + uniform float3 rotation) +{ + pos = math::normalize(pos); + + //for now, a simple XYZ Euler rotation + pos = rotate_around_x(pos, rotation[0]); + pos = rotate_around_y(pos, rotation[1]); + pos = rotate_around_z(pos, -0.25 + rotation[2]); // -90 in degree + + float3 p = float3(-pos.x, pos.y, pos.z); + float3 pm = math::abs(p); + float2 seg = float2(p.z > 0.0 ? 2.0 : 0.0, 0.0); + float2 uv = float2(-p.x / p.z, -p.y / pm.z) * 0.5 + float2(0.5); + + uv = (pm.x < pm.y && pm.z < pm.y) ? + (float2(-p.x / p.y, p.z / pm.y) * 0.5 + float2(0.5)) : + uv; + + seg = (pm.x < pm.y && pm.z < pm.y) ? + float2(p.y > 0.0 ? 0.0 : 2.0, 1.0) : + seg; + + uv = (pm.x > pm.y && pm.z < pm.x) ? + ((p.x > 0.0 ? float2(p.z, -p.y) : float2(-p.y, p.z)) * 0.5 / pm.x + float2(0.5)) : + uv; + + seg = (pm.x > pm.y && pm.z < pm.x) ? + (p.x > 0.0 ? float2(1.0, 0.0) : float2(1.0)) : + seg; + + uv = float2(0.5) + math::atan((2.0 * uv - 1.0) * 0.997) * 2.0 / math::acos(-1.0); + uv = (math::frac(uv) + seg) / float2(3.0, 2.0); + + //Lat-Long projection + uv = xyz_to_uv(float3(p.x, -p.z, p.y)); + + return float3(uv[0], uv[1], pos.z); +} + + +export base::texture_coordinate_info compute_texture_coordinate_2( + uniform base::texture_coordinate_system texture_coordinate_system = base::texture_coordinate_world, + uniform int uv_set = 0, + uniform float s_offset = 0.0f, + uniform float t_offset = 0.0f, + uniform float s_scale = 1.0f, + uniform float t_scale = 1.0f, + uniform bool s_flip = false, + uniform bool t_flip = false, + uniform bool swap_st = false, + uniform projection_mode extended_projection_mode = projection_cubic, + uniform float3 projection_translate = float3(0.0), + uniform float3 projection_rotate = float3(0.0), + uniform float3 projection_scale = float3(1.0)) varying +{ + base::texture_coordinate_info texture_coordinate_info; + if (texture_coordinate_system == base::texture_coordinate_uvw) + { + texture_coordinate_info = base::coordinate_source( + base::texture_coordinate_uvw, + uv_set); + } + else + { + if (extended_projection_mode == projection_latitude_longitude) + { + texture_coordinate_info = base::coordinate_source(texture_coordinate_system, uv_set); + texture_coordinate_info.position = compute_latitude_longitude_projection( + texture_coordinate_info.position, + projection_rotate); + } + else + { + texture_coordinate_info = base::coordinate_projection( + texture_coordinate_system, + uv_set, + to_native_projection_mode(extended_projection_mode), + base::rotation_translation_scale( + projection_rotate, + projection_translate, + projection_scale)); + } + } + + //transform + float4x4 scale( + s_scale, 0.0, 0.0, 0.0, + 0.0, t_scale, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + float4 position = + scale * float4( + swap_st ? + texture_coordinate_info.position.y + s_offset : + texture_coordinate_info.position.x + s_offset, + + swap_st ? + texture_coordinate_info.position.x + t_offset : + texture_coordinate_info.position.y + t_offset, + + texture_coordinate_info.position.z, + 1.0 + ); + + texture_coordinate_info.position = float3( + s_flip ? -position.x : position.x, + t_flip ? -position.y : position.y, + position.z); + + return texture_coordinate_info; +} + + +export base::texture_return texture_lookup_2( + uniform texture_2d texture = texture_2d(), + uniform bool ignore_missing_texture = false, + color missing_color = color(0.0), + uniform bool use_uv_coords = false, + float2 uv_coords = float2(0.0), + uniform wrap_mode s_wrap = wrap_periodic, + uniform wrap_mode t_wrap = wrap_periodic, + base::texture_coordinate_info texture_coordinate_info = base::texture_coordinate_info()) +{ + if ((ignore_missing_texture && tex::texture_isvalid(texture) == false) || + (tex::width(texture) == 0) || (tex::height(texture) == 0)) + { + return base::texture_return(missing_color, 0.0f); + } + + if (use_uv_coords) + { + texture_coordinate_info.position.x = uv_coords[0]; + texture_coordinate_info.position.y = uv_coords[1]; + } + + tex::wrap_mode s_wrap_native = tex::wrap_clip; + switch (s_wrap) + { + case wrap_periodic: + s_wrap_native = tex::wrap_repeat; + break; + + case wrap_black: + s_wrap_native = tex::wrap_clip; + break; + + case wrap_clamp: + s_wrap_native = tex::wrap_clamp; + break; + + case wrap_mirror: + s_wrap_native = tex::wrap_mirrored_repeat; + break; + + case wrap_file: + //Not implemented, valid only for openexr. + break; + + case wrap_missing: + if (texture_coordinate_info.position.x < 0.0f || + texture_coordinate_info.position.x > 1.0f) + { + return base::texture_return(missing_color, 0.0f); + } + } + + tex::wrap_mode t_wrap_native = tex::wrap_clip; + switch (t_wrap) + { + case wrap_periodic: + t_wrap_native = tex::wrap_repeat; + break; + + case wrap_black: + t_wrap_native = tex::wrap_clip; + break; + + case wrap_clamp: + t_wrap_native = tex::wrap_clamp; + break; + + case wrap_mirror: + t_wrap_native = tex::wrap_mirrored_repeat; + break; + + case wrap_file: + //Not implemented, valid only for openexr. + break; + + case wrap_missing: + if (texture_coordinate_info.position.y < 0.0f || + texture_coordinate_info.position.y > 1.0f) + { + return base::texture_return(missing_color, 0.0f); + } + } + + float4 result = tex::lookup_float4( + texture, + float2(texture_coordinate_info.position.x, texture_coordinate_info.position.y), + s_wrap_native, + t_wrap_native, + float2(0.0, 1.0), + float2(0.0, 1.0)); + + return base::texture_return( + color(result.x, result.y, result.z), + result.w); +} + + +export float3 tangent_space_normal_lookup_2( + uniform texture_2d texture = texture_2d(), + uniform bool ignore_missing_texture = false, + uniform bool use_uv_coords = false, + float2 uv_coords = float2(0.0), + uniform wrap_mode s_wrap = wrap_periodic, + uniform wrap_mode t_wrap = wrap_periodic, + uniform bool s_flip = false, + uniform bool t_flip = false, + uniform float tangent_space_factor = 1.0f, + uniform bool tangent_space_flip_r_channel = false, + uniform bool tangent_space_flip_g_channel = false, + uniform bool tangent_space_flip_b_channel = false, + base::texture_coordinate_info texture_coordinate_info = base::texture_coordinate_info()) +{ + if ((ignore_missing_texture && tex::texture_isvalid(texture) == false) || + (tex::width(texture) == 0) || (tex::height(texture) == 0)) + { + return math::normalize( + texture_coordinate_info.tangent_u + + texture_coordinate_info.tangent_v + + state::normal()); + } + + if (use_uv_coords) + { + texture_coordinate_info.position.x = uv_coords[0]; + texture_coordinate_info.position.y = uv_coords[1]; + } + + tex::wrap_mode s_wrap_native = tex::wrap_clip; + switch (s_wrap) + { + case wrap_periodic: + s_wrap_native = tex::wrap_repeat; + break; + + case wrap_black: + s_wrap_native = tex::wrap_clip; + break; + + case wrap_clamp: + s_wrap_native = tex::wrap_clamp; + break; + + case wrap_mirror: + s_wrap_native = tex::wrap_mirrored_repeat; + break; + + case wrap_file: + //Not implemented, valid only for openexr. + break; + + case wrap_missing: + if (texture_coordinate_info.position.x < 0.0f || + texture_coordinate_info.position.x > 1.0f) + { + return math::normalize( + texture_coordinate_info.tangent_u + + texture_coordinate_info.tangent_v + + state::normal()); + } + } + + tex::wrap_mode t_wrap_native = tex::wrap_clip; + switch (t_wrap) + { + case wrap_periodic: + t_wrap_native = tex::wrap_repeat; + break; + + case wrap_black: + t_wrap_native = tex::wrap_clip; + break; + + case wrap_clamp: + t_wrap_native = tex::wrap_clamp; + break; + + case wrap_mirror: + t_wrap_native = tex::wrap_mirrored_repeat; + break; + + case wrap_file: + //Not implemented, valid only for openexr. + break; + + case wrap_missing: + if (texture_coordinate_info.position.y < 0.0f || + texture_coordinate_info.position.y > 1.0f) + { + return math::normalize( + texture_coordinate_info.tangent_u + + texture_coordinate_info.tangent_v + + state::normal()); + } + } + + bool local_s_flip = s_flip; + bool local_t_flip = t_flip; + + //If mirror repeat was selected for tangent space texture, tangent space + //needs to be flipped for every other tile. Please note this is not matching + //with Arnold's aiImage but it would make sense to have like this. + if (s_wrap_native == tex::wrap_mirrored_repeat) + { + if (texture_coordinate_info.position.x > 0.0f && + int(texture_coordinate_info.position.x) % 2 == 1) + { + local_s_flip = !local_s_flip; + } + else if (texture_coordinate_info.position.x < 0.0f && + int(texture_coordinate_info.position.x) % 2 == 0) + { + local_s_flip = !local_s_flip; + } + } + + if (t_wrap_native == tex::wrap_mirrored_repeat) + { + if (texture_coordinate_info.position.y > 0.0f && + int(texture_coordinate_info.position.y) % 2 == 1) + { + local_t_flip = !local_t_flip; + } + else if (texture_coordinate_info.position.y < 0.0f && + int(texture_coordinate_info.position.y) % 2 == 0) + { + local_t_flip = !local_t_flip; + } + } + + float3 transformed_tangent_u = texture_coordinate_info.tangent_u; + float3 transformed_tangent_v = texture_coordinate_info.tangent_v; + + if (local_s_flip) + transformed_tangent_u = -transformed_tangent_u; + + if (local_t_flip) + transformed_tangent_v = -transformed_tangent_v; + + float3 result = tex::lookup_float3( + texture, + float2(texture_coordinate_info.position.x, texture_coordinate_info.position.y), + s_wrap_native, + t_wrap_native, + float2(0.0, 1.0), + float2(0.0, 1.0)); + + if (tangent_space_flip_r_channel) + result.x = 1.0f - result.x; + + if (!tangent_space_flip_g_channel) + result.y = 1.0f - result.y; + + if (tangent_space_flip_b_channel) + result.z = 1.0f - result.z; + + result = (result - float3(0.5)) * (2.0f * tangent_space_factor); + + return math::normalize( + transformed_tangent_u * result.x + + transformed_tangent_v * result.y + + state::normal() * (result.z + (1.0f - tangent_space_factor))); +} + + +export struct normal_roughness_data +{ + float3 normal; + float2 roughness; +}; + + +export float3 hemi_octahedron_to_unit_vector(float2 oct) +{ + oct = float2(oct.x + oct.y, oct.x - oct.y) * 0.5f; + float3 n = float3(oct.x, oct.y, 1.0f - math::dot(float2(1.0), math::abs(oct))); + return math::normalize(n); +} + +export normal_roughness_data tangent_space_normal_roughness_lookup_2( + uniform texture_2d texture = texture_2d(), + uniform bool ignore_missing_texture = false, + uniform bool use_uv_coords = false, + float2 uv_coords = float2(0.0), + uniform wrap_mode s_wrap = wrap_periodic, + uniform wrap_mode t_wrap = wrap_periodic, + uniform bool s_flip = false, + uniform bool t_flip = false, + uniform float tangent_space_factor = 1.0f, + uniform bool tangent_space_flip_r_channel = false, + uniform bool tangent_space_flip_g_channel = false, + uniform bool tangent_space_flip_b_channel = false, + base::texture_coordinate_info texture_coordinate_info = base::texture_coordinate_info()) +{ + if ((ignore_missing_texture && tex::texture_isvalid(texture) == false) || + (tex::width(texture) == 0) || (tex::height(texture) == 0)) + { + return normal_roughness_data( + math::normalize( + texture_coordinate_info.tangent_u + + texture_coordinate_info.tangent_v + + state::normal() + ), + float2(0.0) + ); + } + + if (use_uv_coords) + { + texture_coordinate_info.position.x = uv_coords[0]; + texture_coordinate_info.position.y = uv_coords[1]; + } + + tex::wrap_mode s_wrap_native = tex::wrap_clip; + switch (s_wrap) + { + case wrap_periodic: + s_wrap_native = tex::wrap_repeat; + break; + + case wrap_black: + s_wrap_native = tex::wrap_clip; + break; + + case wrap_clamp: + s_wrap_native = tex::wrap_clamp; + break; + + case wrap_mirror: + s_wrap_native = tex::wrap_mirrored_repeat; + break; + + case wrap_file: + //Not implemented, valid only for openexr. + break; + + case wrap_missing: + if (texture_coordinate_info.position.x < 0.0f || + texture_coordinate_info.position.x > 1.0f) + { + return normal_roughness_data( + math::normalize( + texture_coordinate_info.tangent_u + + texture_coordinate_info.tangent_v + + state::normal() + ), + float2(0.0) + ); + } + } + + tex::wrap_mode t_wrap_native = tex::wrap_clip; + switch (t_wrap) + { + case wrap_periodic: + t_wrap_native = tex::wrap_repeat; + break; + + case wrap_black: + t_wrap_native = tex::wrap_clip; + break; + + case wrap_clamp: + t_wrap_native = tex::wrap_clamp; + break; + + case wrap_mirror: + t_wrap_native = tex::wrap_mirrored_repeat; + break; + + case wrap_file: + //Not implemented, valid only for openexr. + break; + + case wrap_missing: + if (texture_coordinate_info.position.y < 0.0f || + texture_coordinate_info.position.y > 1.0f) + { + return normal_roughness_data( + math::normalize( + texture_coordinate_info.tangent_u + + texture_coordinate_info.tangent_v + + state::normal() + ), + float2(0.0) + ); + } + } + + bool local_s_flip = s_flip; + bool local_t_flip = t_flip; + + //If mirror repeat was selected for tangent space texture, tangent space + //needs to be flipped for every other tile. Please note this is not matching + //with Arnold's aiImage but it would make sense to have like this. + if (s_wrap_native == tex::wrap_mirrored_repeat) + { + if (texture_coordinate_info.position.x > 0.0f && + int(texture_coordinate_info.position.x) % 2 == 1) + { + local_s_flip = !local_s_flip; + } + else if (texture_coordinate_info.position.x < 0.0f && + int(texture_coordinate_info.position.x) % 2 == 0) + { + local_s_flip = !local_s_flip; + } + } + + if (t_wrap_native == tex::wrap_mirrored_repeat) + { + if (texture_coordinate_info.position.y > 0.0f && + int(texture_coordinate_info.position.y) % 2 == 1) + { + local_t_flip = !local_t_flip; + } + else if (texture_coordinate_info.position.y < 0.0f && + int(texture_coordinate_info.position.y) % 2 == 0) + { + local_t_flip = !local_t_flip; + } + } + + float3 transformed_tangent_u = texture_coordinate_info.tangent_u; + float3 transformed_tangent_v = texture_coordinate_info.tangent_v; + + if (local_s_flip) + transformed_tangent_u = -transformed_tangent_u; + + if (local_t_flip) + transformed_tangent_v = -transformed_tangent_v; + + float3 tangent_space_normal; + float2 roughness; + float4 normal_raw = tex::lookup_float4( + texture, + float2(texture_coordinate_info.position.x, texture_coordinate_info.position.y), + s_wrap_native, + t_wrap_native, + float2(0.0, 1.0), + float2(0.0, 1.0), + 0.0f); + + if (tangent_space_flip_r_channel) + normal_raw.x = 1.0f - normal_raw.x; + + if (!tangent_space_flip_g_channel) + normal_raw.y = 1.0f - normal_raw.y; + + if (tangent_space_flip_b_channel) + normal_raw.z = 1.0f - normal_raw.z; + + if (normal_raw.x > 1.5f) + { + // octahedron packed by OV + normal_raw.x -= 2.0; + tangent_space_normal = hemi_octahedron_to_unit_vector( + (float2(normal_raw.x, normal_raw.y) - float2(0.5)) * (2.0f * tangent_space_factor)); + + roughness = float2(normal_raw.z, normal_raw.w) * tangent_space_factor; + } + else + { + // regular + tangent_space_normal = + (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * (2.0f * tangent_space_factor); + + roughness = float2(0.0); + } + + return normal_roughness_data( + math::normalize( + transformed_tangent_u * tangent_space_normal.x + + transformed_tangent_v * tangent_space_normal.y + + state::normal() * (tangent_space_normal.z + (1.0f - tangent_space_factor))), + roughness + ); +} + + +export float3 normal_mapping( + varying float3 normal = float3(0.0, 0.0, 1.0), + uniform tangent_bitangent_mapping tangent_bitangent_mapping = red_green, + varying float3 normal_camera = state::normal()) varying +{ + if (math::length(normal) > 0.0f) + { + int ti = tangent_bitangent_mapping/4; + int bi = tangent_bitangent_mapping&3; + return float3(normal[ti], normal[bi], normal[3-ti-bi]); + } + + return normal_camera; +} + + +export base::texture_return texture_alpha_channel_remap_2( + base::texture_return texture_data, + uniform alpha_mode alpha_source = alpha_default +) +{ + color tint = texture_data.tint; + float3 tint3f = float3(tint); + float mono; + switch (alpha_source) + { + case alpha_default: + mono = texture_data.mono; + break; + + case alpha_red: + mono = tint3f.x; + break; + + case alpha_green: + mono = tint3f.y; + break; + + case alpha_blue: + mono = tint3f.z; + break; + + case alpha_white: + mono = 1.0f; + break; + + case alpha_black: + mono = 0.0f; + break; + + case alpha_luminance: + mono = math::luminance(tint); + break; + + case alpha_average: + mono = math::average(tint); + break; + } + + return base::texture_return(texture_data.tint, mono); +} + + +export base::texture_return texture_adjustment_2( + base::texture_return texture_data, + float exposure = 0.0f, + color default_color = color(0.5), + color color_gain = color(1.0), + color color_offset = color(0.0), + float alpha_gain = 1.0f, + float alpha_offset = 0.0f, + uniform bool invert = false, + float blend_factor = 0.0f) +{ + color tint = texture_data.tint; + float mono = texture_data.mono; + + tint = math::pow(2.0, exposure) * tint; + + if (invert) + { + tint = color(1.0) - tint; + mono = 1.0f - mono; + } + + tint = tint * color_gain + color_offset; + mono = mono * alpha_gain + alpha_offset; + + tint = math::lerp(tint, default_color, blend_factor); + mono = mono * (1.0f - blend_factor); + + return base::texture_return(tint, mono); +} \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurface/OmniShared.mdl b/unitree_z1/materials/mdl/OmniSurface/OmniShared.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f8778f3093cea4b87e347bfe76b0fa981def9ca2 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/OmniShared.mdl @@ -0,0 +1,704 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +// OmniSurface shared utilities + +mdl 1.7; + +import ::anno::*; +import ::math::*; +import ::state::*; + +export struct metal_complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +export metal_complex_ior compute_artistic_to_conductor_fresnel( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return metal_complex_ior(n, k); +} + + +export float2 compute_anisotropy(float roughness, float anisotropy) +{ + float r = math::sqrt(1.0f - math::clamp(anisotropy, 0.0f, 0.98f)); + return float2(math::min(roughness / r, 1.0f), roughness * r); +} + + +export float compute_reflection_from_ior(float ior) +{ + return ((1.0f - ior) * (1.0f - ior)) / ((1.0f + ior) * (1.0f + ior)); +} + + +export struct fresnel_reflectivity +{ + float nr; //normal reflectivity + float gr; //grazing reflectivity +}; + + +export fresnel_reflectivity approximate_fresnel(float ior, float roughness) +{ + float r = (ior - 1.0f) / (ior + 1.0f); + float nr = r * r; + float gr = math::max((1.0 - roughness), 0.0); + + return fresnel_reflectivity(nr, gr); +} + + +export float3 rotate_tangent(float3 tangent, float rotation) +{ + float rot_angle = 2.0f * math::PI * rotation; + float3 bitangent = math::normalize(math::cross(state::normal(), tangent)); + float cos_rot_angle = math::cos(rot_angle); + float sin_rot_angle = math::sin(rot_angle); + return cos_rot_angle * tangent - sin_rot_angle * bitangent; +} + + +//https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_slides_v2.pdf +//Phase function eccentricity 'g' has been omitted here since we pass that directly +//to anisotropic_vdf(directional_bias: g). +export color compute_albedo(color transmission_color) +{ + return color(4.09712) + + (4.20863f * transmission_color) - + math::sqrt( + 9.59217f + + 41.6808f * transmission_color + + 17.7126f * transmission_color * transmission_color); +} + + +export struct volume_coefficients +{ + color scattering; + color absorption; +}; + + +export volume_coefficients compute_subsurface_volume_coefficients( + color transmission_color, + color scattering_color, + float g, + float scale) +{ + color albedo = compute_albedo(transmission_color); + color alpha = + (color(1.0) - albedo * albedo) / (color(1.0) - g * (albedo * albedo)); + + color sigma_s = alpha / (scale * scattering_color); + color sigma_a = + (color(1.0) / (scale * scattering_color)) - sigma_s; + + return volume_coefficients(sigma_s, sigma_a); +} + + +export volume_coefficients compute_transmission_volume_coefficients( + color transmission_color, + color scattering_color, + float depth) +{ + if (depth == 0.0f) + return volume_coefficients(color(0.0), color(0.0)); + + color sigma_t = + math::log(transmission_color / (1.0f + math::max_value(scattering_color))) / + (-1.0f * depth); + + color albedo = compute_albedo(transmission_color * scattering_color); + color albedo_2 = albedo * albedo; + color albedo_4 = albedo_2 * albedo_2; + color sigma_a = sigma_t * albedo_4; + color sigma_s = sigma_t - sigma_a; + return volume_coefficients(sigma_s, sigma_a); +} + + +export struct scattering_colors +{ + color scattering_transmission_color; + color scattering_scattering_color; //radius, not a typo here. +}; + + +export enum scattering_colors_presets +[[ + anno::description("Scattering transmission color and radius presets") +]] +{ + scattering_colors_apple = 0 [[ + anno::display_name("Apple") + ]], + + scattering_colors_chicken = 1 [[ + anno::display_name("Chicken") + ]], + + scattering_colors_cream = 2 [[ + anno::display_name("Cream") + ]], + + scattering_colors_ketchup = 3 [[ + anno::display_name("Ketchup") + ]], + + scattering_colors_marble = 4 [[ + anno::display_name("Marble") + ]], + + scattering_colors_potato = 5 [[ + anno::display_name("Potato") + ]], + + scattering_colors_skim_milk = 6 [[ + anno::display_name("Skim Milk") + ]], + + scattering_colors_whole_milk = 7 [[ + anno::display_name("Whole Milk") + ]], + + scattering_colors_skin_1 = 8 [[ + anno::display_name("Skin 1") + ]], + + scattering_colors_skin_2 = 9 [[ + anno::display_name("Skin 2") + ]], + + scattering_colors_skin_3 = 10 [[ + anno::display_name("Skin 3") + ]], + + scattering_colors_skin_4 = 11 [[ + anno::display_name("Skin 4") + ]], + + scattering_colors_custom = 12 [[ + anno::display_name("Custom") + ]] +}; + + +// Values are from Henrik Wann Jensen, Stephen R. Marschner, Marc Levoy, and +// Pat Hanrahan. A Practical Model for Subsurface Light Transport. Proceedings +// of SIGGRAPH 2001, pages 511-518. +export scattering_colors scattering_colors_preset_to_value( + scattering_colors_presets preset, + color scattering_transmission_color = color(1.0), + color scattering_scattering_color = color(1.0)) +[[ + anno::description("Return scattering colors based on preset.") +]] +{ + if (preset == scattering_colors_apple) + return scattering_colors( + color(0.430, 0.210, 0.170), + color(11.610, 3.880, 1.750)); + + if (preset == scattering_colors_chicken) + return scattering_colors( + color(0.440, 0.220, 0.140), + color(9.440, 3.350, 1.790)); + + if (preset == scattering_colors_cream) + return scattering_colors( + color(0.990, 0.940, 0.830), + color(15.030, 4.660, 2.540)); + + if (preset == scattering_colors_ketchup) + return scattering_colors( + color(0.220, 0.010, 0.001), + color(4.760, 0.570, 0.390)); + + if (preset == scattering_colors_marble) + return scattering_colors( + color(0.930, 0.910, 0.880), + color(8.510, 5.570, 3.950)); + + if (preset == scattering_colors_potato) + return scattering_colors( + color(0.860, 0.740, 0.290), + color(14.270, 7.230, 2.040)); + + if (preset == scattering_colors_skim_milk) + return scattering_colors( + color(0.890, 0.890, 0.800), + color(18.420, 10.440, 3.500)); + + if (preset == scattering_colors_whole_milk) + return scattering_colors( + color(0.950, 0.930, 0.850), + color(10.900, 6.580, 2.510)); + + if (preset == scattering_colors_skin_1) + return scattering_colors( + color(0.570, 0.310, 0.170), + color(3.670, 1.370, 0.680)); + + if (preset == scattering_colors_skin_2) + return scattering_colors( + color(0.750, 0.570, 0.470), + color(4.820, 1.690, 1.090)); + + if (preset == scattering_colors_skin_3) + return scattering_colors( + color(0.999, 0.615, 0.521), + color(1.000, 0.300, 0.100)); + + if (preset == scattering_colors_skin_4) + return scattering_colors( + color(0.078, 0.043, 0.025), + color(0.723, 0.264, 0.127)); + + return scattering_colors( + scattering_transmission_color, + scattering_scattering_color); +} + + +export enum ior_presets +[[ + anno::description("Index of refraction preset") +]] +{ + ior_acrylic_glass = 0 [[ + anno::display_name("Acrylic Glass") + ]], + + ior_air = 1 [[ + anno::display_name("Air") + ]], + + ior_crystal = 2 [[ + anno::display_name("Crystal") + ]], + + ior_diamond = 3 [[ + anno::display_name("Diamond") + ]], + + ior_emerald = 4 [[ + anno::display_name("Emerald") + ]], + + ior_ethanol = 5 [[ + anno::display_name("Ethanol") + ]], + + ior_flint_glass = 6 [[ + anno::display_name("Flint Glass") + ]], + + ior_glass = 7 [[ + anno::display_name("Glass") + ]], + + ior_honey_21p_water = 8 [[ + anno::display_name("Honey 21% Water") + ]], + + ior_human_eye_aqueous_humor = 9 [[ + anno::display_name("Human Eye Aqueous Humor") + ]], + + ior_human_eye_cornea = 10 [[ + anno::display_name("Human Eye Cornea") + ]], + + ior_human_eye_lens = 11 [[ + anno::display_name("Human Eye Lens") + ]], + + ior_human_eye_vitreous_humor = 12 [[ + anno::display_name("Human Eye Vitreous Humor") + ]], + + ior_human_skin = 13 [[ + anno::display_name("Human Skin") + ]], + + ior_human_hair = 14 [[ + anno::display_name("Human Hair") + ]], + + ior_human_wet_hair = 15 [[ + anno::display_name("Human Wet Hair") + ]], + + ior_ice = 16 [[ + anno::display_name("Ice") + ]], + + ior_milk = 17 [[ + anno::display_name("Milk") + ]], + + ior_olive_oil = 18 [[ + anno::display_name("Olive Oil") + ]], + + ior_pearl = 19 [[ + anno::display_name("Pearl") + ]], + + ior_plastic = 20 [[ + anno::display_name("Plastic") + ]], + + ior_sapphire = 21 [[ + anno::display_name("Sapphire") + ]], + + ior_soap_bubble = 22 [[ + anno::display_name("Soap Bubble") + ]], + + ior_vacuum = 23 [[ + anno::display_name("Vacuum") + ]], + + ior_water_0c = 24 [[ + anno::display_name("Water 0C") + ]], + + ior_water_35c = 25 [[ + anno::display_name("Water 35C") + ]], + + ior_water_100c = 26 [[ + anno::display_name("Water 100C") + ]], + + ior_custom = 99 [[ + anno::display_name("Custom") + ]] +}; + + +export float ior_preset_to_value( + ior_presets preset, + uniform float custom = 1.0f) uniform +[[ + anno::description("Return ior value based on preset.") +]] +{ + if (preset == ior_acrylic_glass) + return 1.49f; + + if (preset == ior_air) + return 1.0f; + + if (preset == ior_crystal) + return 2.0f; + + if (preset == ior_diamond) + return 2.42f; + + if (preset == ior_emerald) + return 1.56f; + + if (preset == ior_ethanol) + return 1.36f; + + if (preset == ior_flint_glass) + return 1.66f; + + if (preset == ior_glass) + return 1.5f; + + if (preset == ior_honey_21p_water) + return 1.484f; + + if (preset == ior_human_eye_aqueous_humor) + return 1.33f; + + if (preset == ior_human_eye_cornea) + return 1.37f; + + if (preset == ior_human_eye_lens) + return 1.41f; + + if (preset == ior_human_eye_vitreous_humor) + return 1.34f; + + if (preset == ior_human_skin) + return 1.4f; + + if (preset == ior_human_hair) + return 1.55f; + + if (preset == ior_human_wet_hair) + return 1.85f; + + if (preset == ior_ice) + return 1.31f; + + if (preset == ior_milk) + return 1.35f; + + if (preset == ior_olive_oil) + return 1.47f; + + if (preset == ior_pearl) + return 1.53f; + + if (preset == ior_plastic) + return 1.55f; + + if (preset == ior_sapphire) + return 1.77f; + + if (preset == ior_soap_bubble) + return 1.4f; + + if (preset == ior_vacuum) + return 1.0f; + + if (preset == ior_water_0c) + return 1.333f; + + if (preset == ior_water_35c) + return 1.325f; + + if (preset == ior_water_100c) + return 1.318f; + + return custom; +} + + +float3 transform_internal_to_tangent(float3 n) +{ + return + n.x * float3( + state::texture_tangent_u(0).x, + state::texture_tangent_v(0).x, + state::normal().x) + + + n.y * float3( + state::texture_tangent_u(0).y, + state::texture_tangent_v(0).y, + state::normal().y) + + + n.z * float3( + state::texture_tangent_u(0).z, + state::texture_tangent_v(0).z, + state::normal().z); +} + + +float3 transform_tangent_to_internal(float3 n) +{ + return + state::texture_tangent_u(0) * n.x + + state::texture_tangent_v(0) * n.y + + state::normal() * n.z ; +} + + +export float3 add_detail_normal( + float3 nd = state::normal(), + float3 n = state::normal()) +{ + float3 n_t = transform_internal_to_tangent(n); + float3 nd_t = transform_internal_to_tangent(nd); + + n_t = n_t + float3(0.0, 0.0, 1.0); + nd_t = nd_t * float3(-1.0, -1.0, 1.0); + + n = n_t * math::dot(n_t, nd_t) / n_t.z - nd_t; + return math::normalize(transform_tangent_to_internal(n)); +} + + +export enum normal_mode +[[ + anno::description("Normal Mode") +]] +{ + normal_tangent_space = 0 [[ + anno::display_name("Tangent Space") + ]], + + normal_object_space = 1 [[ + anno::display_name("Object Space") + ]] +}; + + +export enum displacement_mode +[[ + anno::description("Displacement Mode") +]] +{ + displacement_height = 0 [[ + anno::display_name("Height") + ]], + + displacement_vector_tangent_space = 1 [[ + anno::display_name("Vector, Tangent Space") + ]], + + displacement_vector_object_space = 2 [[ + anno::display_name("Vector, Object Space") + ]], + + displacement_vector_world_space = 3 [[ + anno::display_name("Vector, World Space") + ]] +}; + + +export float3 displacement_adjustment( + float3 displacement = float3(0.0), + uniform displacement_mode mode = displacement_height, + float scale = 1.0f) +{ + float3 result; + switch (mode) + { + case displacement_height: + result = state::normal() * displacement * scale; + break; + + case displacement_vector_tangent_space: + result = + state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale); + break; + + default: + result = state::position(); + break; + } + + return result; +} + + +export enum emission_mode +[[ + anno::description("Emission Mode") +]] +{ + emission_lx = 0 [[ + anno::display_name("Lux - lx (lm/m2)") + ]], + + emission_nt = 1 [[ + anno::display_name("Nit - nt (cd/m2)") + ]] +}; + + +export enum melanin_concentration_presets +[[ + anno::description("Melanin concentration presets") +]] +{ + melanin_concentration_white = 0 [[ + anno::display_name("White") + ]], + + melanin_concentration_platinum_blonde = 1 [[ + anno::display_name("Platinum Blonde") + ]], + + melanin_concentration_light_blonde = 2 [[ + anno::display_name("Light Blonde") + ]], + + melanin_concentration_blonde = 3 [[ + anno::display_name("Blonde") + ]], + + melanin_concentration_dark_blonde = 4 [[ + anno::display_name("Dark Blonde") + ]], + + melanin_concentration_dark_brown = 5 [[ + anno::display_name("Dark Brown") + ]], + + melanin_concentration_black = 6 [[ + anno::display_name("Black") + ]], + + melanin_concentration_custom = 7 [[ + anno::display_name("Custom") + ]] +}; + +export float melanin_concentration_preset_to_value( + melanin_concentration_presets preset, + float melanin_concentration_value = 1.0f) +[[ + anno::description("Return melanin concentration value based on a preset.") +]] +{ + if (preset == melanin_concentration_white) + return 0.0f; + + if (preset == melanin_concentration_platinum_blonde) + return 0.0025f; + + if (preset == melanin_concentration_light_blonde) + return 0.10f; + + if (preset == melanin_concentration_blonde) + return 0.175f; + + if (preset == melanin_concentration_dark_blonde) + return 0.30f; + + if (preset == melanin_concentration_dark_brown) + return 0.65f; + + if (preset == melanin_concentration_black) + return 1.0f; + + return melanin_concentration_value; +} diff --git a/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceBase.mdl b/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..89b835161feb182101314f9e70078b8c0a8dd9ac --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceBase.mdl @@ -0,0 +1,875 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +// Implementation of OmniSurfaceBase material + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::limits::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +// Using absolute path to OmniShared library +import OmniShared::*; + +export material OmniSurfaceBase( + + //Diffuse reflection + // + float diffuse_reflection_weight = float(0.8) [[ + anno::display_name("Weight"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + color diffuse_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Base") + ]], + + float diffuse_reflection_roughness = float(0.0) [[ + anno::display_name("Diffuse Roughness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + //Metalness + // + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + //Specular reflection + // + float specular_reflection_weight = float(1.0) [[ + anno::display_name("Weight"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + color specular_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Specular") + ]], + + float specular_reflection_roughness = float(0.2) [[ + anno::display_name("Roughness"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::ior_presets specular_reflection_ior_preset = + OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Specular") + ]], + + uniform float specular_reflection_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Specular"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float specular_reflection_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + float specular_reflection_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Specular"), + anno::soft_range(0.0f, 1.0f) + ]], + + //Specular transmission + // + uniform bool enable_specular_transmission = false [[ + anno::display_name("Enable Transmission"), + anno::description("Enables the use of transmission"), + anno::in_group("Transmission") + ]], + + float specular_transmission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0f, 1.0f) + ]], + + color specular_transmission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Transmission") + ]], + + float specular_transmission_scattering_depth = float(0.0) [[ + anno::display_name("Depth"), + anno::in_group("Transmission"), + anno::soft_range(0.0f, 100.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + + ]], + + color specular_transmission_scattering_color = color(0.0) [[ + anno::display_name("Scatter"), + anno::in_group("Transmission") + ]], + + float specular_transmission_scatter_anisotropy = float(0.0) [[ + anno::display_name("Scatter Anisotropy"), + anno::in_group("Transmission"), + anno::hard_range(-1.0f, 1.0f) + ]], + + uniform float specular_transmission_dispersion_abbe = float(0.0) [[ + anno::display_name("Dispersion Abbe"), + anno::in_group("Transmission"), + anno::soft_range(0.0f, 100.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + //Subsurface + // + uniform bool enable_diffuse_transmission = false [[ + anno::display_name("Enable Subsurface"), + anno::description("Enables the use of subsurface"), + anno::in_group("Subsurface") + ]], + + float subsurface_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Subsurface"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::scattering_colors_presets subsurface_scattering_colors_preset = + OmniShared::scattering_colors_custom [[ + anno::display_name("Scattering Presets"), + anno::in_group("Subsurface") + ]], + + color subsurface_transmission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Subsurface") + ]], + + color subsurface_scattering_color = color(1.0) [[ + anno::display_name("Radius (mfp)"), + anno::in_group("Subsurface") + ]], + + float subsurface_scale = float(1.0) [[ + anno::display_name("Scale"), + anno::in_group("Subsurface"), + anno::soft_range(0.0f, 10.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float subsurface_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Subsurface"), + anno::hard_range(-1.0f, 1.0f) + ]], + + //Coat + // + float coat_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + color coat_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Coat") + ]], + + float coat_roughness = float(0.1) [[ + anno::display_name("Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::ior_presets coat_ior_preset = + OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Coat") + ]], + + uniform float coat_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Coat"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float coat_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + float coat_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Coat"), + anno::soft_range(0.0f, 1.0f) + ]], + + float coat_affect_color = float(0.0) [[ + anno::display_name("Affect Color"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + float coat_affect_roughness = float(0.0) [[ + anno::display_name("Affect Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + float3 coat_normal = state::normal() [[ + anno::display_name("Normal"), + anno::in_group("Coat"), + anno::usage("normal") + ]], + + //Specular retro-reflection + // + float specular_retro_reflection_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Sheen"), + anno::hard_range(0.0f, 1.0f) + ]], + + color specular_retro_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Sheen") + ]], + + float specular_retro_reflection_roughness = float(0.3) [[ + anno::display_name("Roughness"), + anno::in_group("Sheen"), + anno::hard_range(0.0f, 1.0f) + ]], + + //Emission + // + float emission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Emission"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::emission_mode emission_mode = + OmniShared::emission_lx [[ + anno::display_name("Emission Mode"), + anno::in_group("Emission") + ]], + + float emission_intensity = float(1.0) [[ + anno::display_name("Intensity"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 1000.0f) + ]], + + color emission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Emission") + ]], + + uniform bool emission_use_temperature = false [[ + anno::display_name("Use Temperature"), + anno::in_group("Emission") + ]], + + float emission_temperature = float(6500.0) [[ + anno::display_name("Temperature (kelvin)"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 10000.0f) + ]], + + //Thin Film + // + uniform bool enable_thin_film = false [[ + anno::display_name("Enable Thin Film"), + anno::description("Enable the use of thin film"), + anno::in_group("Thin Film") + ]], + + float thin_film_thickness = float(400.0) [[ + anno::display_name("Thickness (nm)"), + anno::in_group("Thin Film"), + anno::soft_range(0.0f, 2000.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + uniform OmniShared::ior_presets thin_film_ior_preset = + OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Thin Film") + ]], + + uniform float thin_film_ior = float(1.52) [[ + anno::display_name("IOR"), + anno::in_group("Thin Film"), + anno::soft_range(1.0f, 3.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + //Geometry + // + uniform bool thin_walled = false [[ + anno::display_name("Thin Walled"), + anno::description("Thin surface with no interior."), + anno::in_group("Geometry") + ]], + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Geometry") + ]], + + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float geometry_opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials"), + anno::in_group("Geometry") + ]], + + uniform float geometry_normal_roughness_strength = float(1.0) [[ + anno::display_name("Geometry Normal Roughness Strength"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + float2 geometry_normal_roughness = float2(0.0) [[ + anno::display_name("Geometry Normal Roughness"), + anno::in_group("Geometry") + ]], + + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + float3 geometry_displacement = float3(0.0) [[ + anno::display_name("Displacement"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniSurfaceBase"), + anno::description("A base material for modeling a variety of surfaces."), + anno::in_group("Omni Materials", "OmniSurface"), + anno::author("NVIDIA Corporation"), + anno::key_words(string[]("generic", "surface")), + anno::thumbnail(".thumbs/OmniSurfaceBase.png"), + anno::version(1, 0, 0, "") +]] = let { + + //Constants + float epsilon = 1.e-5; + + //Thin film BRDF + float thin_film_ior_value = OmniShared::ior_preset_to_value( + thin_film_ior_preset, + thin_film_ior); + + //Coat - Dielectric microfacet BRDF + float coat_roughness_2 = coat_roughness * coat_roughness; + float2 coat_roughness_anisotropy = + coat_anisotropy != 0.0f ? + OmniShared::compute_anisotropy(coat_roughness_2, coat_anisotropy): + float2(coat_roughness_2); + + float coat_roughness_u = coat_roughness_anisotropy.x; + float coat_roughness_v = coat_roughness_anisotropy.y; + float3 coat_tangent_u = + coat_roughness_anisotropy != 0.0f ? + coat_anisotropy_rotation != 0.0f ? + OmniShared::rotate_tangent( + state::texture_tangent_u(0), + coat_anisotropy_rotation) : + state::texture_tangent_u(0) : + state::texture_tangent_u(0); + + float coat_ior_value = OmniShared::ior_preset_to_value( + coat_ior_preset, + coat_ior); + + OmniShared::fresnel_reflectivity coat_fresnel_reflectivity = + OmniShared::approximate_fresnel( + coat_ior_value, + coat_roughness_2); + + color coat_multiscatter_tint = color(0.92); //heuristic + + bsdf coat_brdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + multiscatter_tint: coat_multiscatter_tint, + tangent_u: coat_tangent_u, + mode: df::scatter_reflect); + + //Specular reflection - Dielectric microfacet BRDF + float specular_reflection_roughness_2 = + specular_reflection_roughness * specular_reflection_roughness; + + float coat_affect_roughness_coefficient = + (coat_weight * coat_roughness_2 * coat_affect_roughness); + + float specular_reflection_roughness_coefficient = + math::lerp(specular_reflection_roughness_2, 1.0f, coat_affect_roughness_coefficient); + + float2 specular_reflection_roughness_anisotropy = + specular_reflection_anisotropy != 0.0f ? + OmniShared::compute_anisotropy( + specular_reflection_roughness_coefficient, + specular_reflection_anisotropy) : + float2(specular_reflection_roughness_coefficient); + + float specular_reflection_roughness_u = + specular_reflection_roughness_anisotropy.x + + geometry_normal_roughness.x * geometry_normal_roughness.x * geometry_normal_roughness_strength; + + float specular_reflection_roughness_v = + specular_reflection_roughness_anisotropy.y + + geometry_normal_roughness.y * geometry_normal_roughness.y * geometry_normal_roughness_strength; + + float3 specular_reflection_tangent_u = + specular_reflection_roughness_anisotropy != 0.0f ? + specular_reflection_anisotropy_rotation != 0.0f ? + OmniShared::rotate_tangent( + state::texture_tangent_u(0), + specular_reflection_anisotropy_rotation) : + state::texture_tangent_u(0) : + state::texture_tangent_u(0); + + float specular_reflection_ior_value = OmniShared::ior_preset_to_value( + specular_reflection_ior_preset, + specular_reflection_ior); + + OmniShared::fresnel_reflectivity specular_reflection_fresnel_reflectivity = + OmniShared::approximate_fresnel( + specular_reflection_ior_value, + specular_reflection_roughness_2); + + color specular_reflection_multiscatter_tint = + specular_reflection_color * color(0.92); //heuristic + + bsdf specular_reflection_to_combine_with_specular_retro_reflection_brdf = + df::microfacet_ggx_smith_bsdf( + roughness_u: specular_reflection_roughness_u, + roughness_v: specular_reflection_roughness_v, + tint: specular_reflection_color, + multiscatter_tint: specular_reflection_multiscatter_tint, + tangent_u: specular_reflection_tangent_u, + mode: df::scatter_reflect); + + color specular_transmission_tint = + thin_walled || (specular_transmission_scattering_depth == 0.0f) ? + specular_transmission_color : + color(1.0); + + bsdf specular_reflection_to_combine_with_specular_transmission_base_brdf_no_film = + df::microfacet_ggx_smith_bsdf( + tint: color(1.0f), + multiscatter_tint: specular_reflection_multiscatter_tint, + roughness_u: specular_reflection_roughness_u, + roughness_v: specular_reflection_roughness_v, + tangent_u: specular_reflection_tangent_u, + mode: df::scatter_reflect_transmit); + + bsdf specular_reflection_to_combine_with_specular_transmission_base_brdf = + enable_thin_film ? + df::thin_film( + ior: color(thin_film_ior_value), + thickness: thin_film_thickness, + base: specular_reflection_to_combine_with_specular_transmission_base_brdf_no_film) : + specular_reflection_to_combine_with_specular_transmission_base_brdf_no_film; + + + bsdf specular_reflection_to_combine_with_specular_transmission_brdf = + df::tint( + reflection_tint: specular_reflection_color, + transmission_tint: specular_transmission_tint, + base: specular_reflection_to_combine_with_specular_transmission_base_brdf); + + //Metal - Conductor microfacet BRDF + float metal_roughness_u = specular_reflection_roughness_u; + float metal_roughness_v = specular_reflection_roughness_v; + float3 metal_tangent_u = specular_reflection_tangent_u; + + color metal_multiscatter_tint = color(1.0); + + bsdf metal_base_brdf = df::microfacet_ggx_smith_bsdf( + roughness_u: metal_roughness_u, + roughness_v: metal_roughness_v, + tint: color(1.0), + multiscatter_tint: metal_multiscatter_tint, + tangent_u: metal_tangent_u, + mode: df::scatter_reflect); + + color metal_base_color = diffuse_reflection_color * diffuse_reflection_weight; + color metal_edge_color = specular_reflection_color * specular_reflection_weight; + OmniShared::metal_complex_ior metal_ior = + OmniShared::compute_artistic_to_conductor_fresnel( + metal_base_color, + metal_edge_color); + + bsdf metal_brdf_fresnel_factored = df::fresnel_factor( + ior: metal_ior.n, + extinction_coefficient: metal_ior.k, + base: metal_base_brdf); + + bsdf metal_brdf = enable_thin_film ? + df::thin_film( + ior: color(thin_film_ior_value), + thickness: thin_film_thickness, + base: metal_brdf_fresnel_factored + ) : + metal_brdf_fresnel_factored; + + //Specular transmission - Dielectric microfacet BTDF + float specular_transmission_roughness_u = specular_reflection_roughness_u; + float specular_transmission_roughness_v = specular_reflection_roughness_v; + float3 specular_transmission_tangent_u = specular_reflection_tangent_u; + + float specular_transmission_ior = specular_reflection_ior_value; + color specular_transmission_ior_color = + specular_transmission_dispersion_abbe > 0.0f ? + base::abbe_number_ior(specular_transmission_ior, specular_transmission_dispersion_abbe) : + color(specular_transmission_ior); + + bsdf specular_transmission_weak_roughness_btdf = df::microfacet_ggx_smith_bsdf( + roughness_u: specular_transmission_roughness_u, + roughness_v: specular_transmission_roughness_v, + tint: specular_transmission_tint, + multiscatter_tint: color(1.0), + tangent_u: specular_transmission_tangent_u, + mode: df::scatter_transmit); //OM-27060 + + bsdf specular_transmission_strong_roughness_btdf = df::diffuse_transmission_bsdf( + tint: specular_transmission_tint); + + float specular_transmission_weak_to_strong_roughness_threshold = 0.35f; + float specular_transmission_weak_to_strong_roughness_offset = 0.35f; + + float specular_transmission_weak_to_strong_roughness_blend = + specular_reflection_roughness > specular_transmission_weak_to_strong_roughness_threshold ? + specular_reflection_roughness - specular_transmission_weak_to_strong_roughness_offset : + 0.0f; + + bsdf specular_transmission_btdf = df::weighted_layer( + weight: specular_transmission_weak_to_strong_roughness_blend, + normal: state::normal(), + base: specular_transmission_weak_roughness_btdf, + layer: specular_transmission_strong_roughness_btdf + ); + + OmniShared::volume_coefficients specular_transmission_vdf_coefficients = + OmniShared::compute_transmission_volume_coefficients( + specular_transmission_color, + specular_transmission_scattering_color, + ::state::meters_per_scene_unit() * specular_transmission_scattering_depth); + + float current_specular_transmission_weight = + enable_specular_transmission ? + specular_transmission_weight : + 0.0f; + + //Specular retro-reflection - Retro-reflective dielectric microfacet BRDF + float specular_retro_reflection_roughness_2 = + specular_retro_reflection_roughness * specular_retro_reflection_roughness; + + color specular_retro_reflection_multiscatter_tint = color(1.0); + + //bsdf specular_retro_reflection_brdf = df::sheen_bsdf( + // roughness: math::max(specular_retro_reflection_roughness_2, epsilon), + // tint: specular_retro_reflection_color, + // multiscatter_tint: specular_retro_reflection_multiscatter_tint); + + //Diffuse reflection - Diffuse microfacet BRDF + float coat_gamma = 1.0f + coat_affect_color * math::clamp(coat_weight, 0.0f, 1.0f); + color diffuse_color = + math::pow(diffuse_reflection_color * diffuse_reflection_weight, coat_gamma); + + bsdf diffuse_reflection_bsdf = df::diffuse_reflection_bsdf( + tint: diffuse_color, + roughness: diffuse_reflection_roughness); + + //Subsurface preset + OmniShared::scattering_colors scattering_colors = + OmniShared::scattering_colors_preset_to_value( + subsurface_scattering_colors_preset, + subsurface_transmission_color, + subsurface_scattering_color); + + //Diffuse transmission - Diffuse microfacet BTDF + color diffuse_transmission_color = thin_walled ? + scattering_colors.scattering_transmission_color : + color(1.0); + + bsdf diffuse_transmission_btdf = df::diffuse_transmission_bsdf( + tint: diffuse_transmission_color); + + float bounded_subsurface_scale = math::max(epsilon, subsurface_scale); + OmniShared::volume_coefficients subsurface_vdf_coefficients = + OmniShared::compute_subsurface_volume_coefficients( + scattering_colors.scattering_transmission_color, + scattering_colors.scattering_scattering_color, + subsurface_anisotropy, + ::state::meters_per_scene_unit() * bounded_subsurface_scale); + + float current_subsurface_weight = + enable_diffuse_transmission ? + subsurface_weight : + 0.0f; + + //Emission - Diffuse emission + uniform float emission_unit_intensity = + (emission_mode == OmniShared::emission_lx) ? + 1.0f : + math::PI; + + color emission_coat_affect = math::lerp(color(1.0), coat_color, coat_weight); + + color emission_final_color = + emission_use_temperature ? + math::blackbody(emission_temperature) : + emission_color; + + color emission_final_intensity = + emission_weight * emission_intensity * emission_unit_intensity * + emission_final_color * emission_coat_affect; + + material_emission emission = material_emission( + emission: + df::directional_factor( + normal_tint: math::lerp( + color(1.0), + color(1.0 - coat_fresnel_reflectivity.nr), + coat_weight + ), + grazing_tint: math::lerp( + color(1.0), + color(1.0 - coat_fresnel_reflectivity.gr), + coat_weight + ), + exponent: 4.0f, //heuristic + base: df::diffuse_edf() + ), + intensity: emission_final_intensity, + mode: intensity_radiant_exitance); + + //Layering + // + //Diffuse transmission | Diffuse reflection + bsdf diffuse_reflection_bsdf_mix = df::weighted_layer( + weight: current_subsurface_weight, + normal: geometry_normal, + base: df::weighted_layer( + weight: 1.0f, + normal: geometry_normal, + base: bsdf(), + layer: diffuse_reflection_bsdf + ), + layer: diffuse_transmission_btdf + ); + + //Diffuse reflection | Specular retro reflection + bsdf specular_retro_reflection_brdf = df::sheen_bsdf( + roughness: specular_retro_reflection_roughness_2, + tint: specular_retro_reflection_color, + multiscatter_tint: specular_retro_reflection_multiscatter_tint, + multiscatter: diffuse_reflection_bsdf_mix + ); + + bsdf specular_retro_reflection_brdf_mix = df::weighted_layer( + weight: specular_retro_reflection_weight, + normal: geometry_normal, + base: diffuse_reflection_bsdf_mix, + layer: specular_retro_reflection_brdf + ); + + //Specular retro reflection | Specular reflection + bsdf specular_reflection_with_specular_retro_reflection_brdf_mix = df::custom_curve_layer( + weight: specular_reflection_weight, + normal: geometry_normal, + normal_reflectivity: specular_reflection_fresnel_reflectivity.nr, + grazing_reflectivity: specular_reflection_fresnel_reflectivity.gr, + exponent: 4.0f, //heuristic + base: specular_retro_reflection_brdf_mix, + layer: specular_reflection_to_combine_with_specular_retro_reflection_brdf + ); + + //Specular transmission | Specular reflection + bsdf specular_reflection_with_specular_transmission_brdf_mix = df::weighted_layer( + weight: specular_reflection_weight, + normal: geometry_normal, + base: specular_transmission_btdf, + layer: specular_reflection_to_combine_with_specular_transmission_brdf + ); + + //Specular reflection with specular retro reflection | Specular reflection with specular transmission + bsdf specular_reflection_brdf_mix = df::weighted_layer( + weight: current_specular_transmission_weight, + normal: geometry_normal, + base: specular_reflection_with_specular_retro_reflection_brdf_mix, + layer: specular_reflection_with_specular_transmission_brdf_mix + ); + + //Specular reflection | Metal + bsdf metal_brdf_mix = df::weighted_layer( + weight: metalness, + normal: geometry_normal, + base: specular_reflection_brdf_mix, + layer: metal_brdf + ); + + //Metal | Coat + bsdf coat_brdf_mix = df::custom_curve_layer( + normal_reflectivity: coat_fresnel_reflectivity.nr, + grazing_reflectivity: coat_fresnel_reflectivity.gr, + weight: coat_weight, + layer: coat_brdf, + base: df::tint( + tint: math::lerp(color(1.0), coat_color, coat_weight), + base: metal_brdf_mix + ), + normal: coat_normal + ); + + //Surface + material_surface surface = material_surface( + scattering: coat_brdf_mix, + emission: emission + ); + + //Back Surface + material_surface back_surface = material_surface( + scattering: bsdf(), + emission: material_emission( + emission: edf(), + intensity: color(0.0), + mode: intensity_radiant_exitance + ) + ); + + //Volume + float specular_transmission_scatter_anisotropy_lower_bound = -0.99f; //heuristic, to avoid artifacts + float subsurface_anisotropy_upper_bound = 0.99f; //heuristic, to avoid artifacts + float volume_directional_bias_mix = + thin_walled || + (current_specular_transmission_weight == 0.0f && current_subsurface_weight == 0.0f) ? + 0.0f : + math::lerp( + math::min( + subsurface_anisotropy_upper_bound, + subsurface_anisotropy + ) * current_subsurface_weight, + math::max( + specular_transmission_scatter_anisotropy_lower_bound, + specular_transmission_scatter_anisotropy + ), + current_specular_transmission_weight + ); + + vdf volume_vdf_mix = df::anisotropic_vdf( + directional_bias: volume_directional_bias_mix + ); + + color volume_scattering_coefficient_mix = + (current_specular_transmission_weight == 0.0f && current_subsurface_weight == 0.0f) ? + color() : + math::lerp( + subsurface_vdf_coefficients.scattering * current_subsurface_weight, + specular_transmission_vdf_coefficients.scattering, + current_specular_transmission_weight + ); + + color volume_absorption_coefficient_mix = + (current_specular_transmission_weight == 0.0f && current_subsurface_weight == 0.0f) ? + color() : + math::lerp( + subsurface_vdf_coefficients.absorption * current_subsurface_weight, + specular_transmission_vdf_coefficients.absorption, + current_specular_transmission_weight + ); + + material_volume volume = + material_volume( + scattering: volume_vdf_mix, + scattering_coefficient: + thin_walled ? + color(0.0) : + volume_scattering_coefficient_mix, + + absorption_coefficient: + thin_walled ? + color(0.0) : + volume_absorption_coefficient_mix + ); + + //Geometry + material_geometry geometry = material_geometry( + displacement: geometry_displacement, + cutout_opacity: enable_opacity ? + geometry_opacity_threshold == 0.0f ? + geometry_opacity : + (geometry_opacity >= geometry_opacity_threshold ? 1.0f : 0.0f) : + 1.0f, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + across_materials: round_edges_across_materials, + roundness: round_edges_roundness + ) + ); + +} in material( + thin_walled: thin_walled, + ior: specular_transmission_ior_color, + surface: surface, + backface: back_surface, + volume: volume, + geometry: geometry +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceBlendBase.mdl b/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceBlendBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c57138e5d4cb7c0d30a21b946be7386557370ec4 --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceBlendBase.mdl @@ -0,0 +1,217 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +// Implementation of OmniSurfaceBlendBase material + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::limits::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +import OmniShared::*; +import OmniImage::*; + +export material OmniSurfaceBlendBase( + + //Materials + // + material base_material = material() [[ + anno::display_name("Base Material"), + anno::in_group("Materials") + ]], + + material blend_material = material() [[ + anno::display_name("Blend Material"), + anno::in_group("Materials") + ]], + + float blend_weight = float(1.0) [[ + anno::display_name("Weight"), + anno::in_group("Blending"), + anno::hard_range(0.0f, 1.0f) + ]], + + //Geometry + // + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Geometry") + ]], + + uniform float geometry_opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]] +) +[[ + anno::display_name("OmniSurfaceBlendBase"), + anno::description("Blend two materials."), + anno::in_group("Omni Materials", "OmniSurface"), + anno::author("NVIDIA Corporation"), + anno::key_words(string[]("generic", "utilities")), + anno::thumbnail(".thumbs/OmniSurfaceBlendBase.png"), + anno::version(1, 0, 0, "") + +]] = let { + + //Emission + // + edf emission_edf_mix = df::normalized_mix( + components: df::edf_component[]( + df::edf_component( + weight: (1.0 - blend_weight), + component: base_material.surface.emission.emission + ), + df::edf_component( + weight: blend_weight, + component: blend_material.surface.emission.emission + ) + ) + ); + + material_emission emission_mix = material_emission( + emission: emission_edf_mix, + intensity: base::blend_color_layers( + base: base_material.surface.emission.intensity, + layers: base::color_layer[]( + base::color_layer( + layer_color: blend_material.surface.emission.intensity, + weight: blend_weight, + mode: base::color_layer_blend + ) + ) + ).tint, + mode: intensity_radiant_exitance + ); + + //Surface + // + bsdf surface_bsdf_mix = df::weighted_layer( + weight: blend_weight, + base: base_material.surface.scattering, + layer: blend_material.surface.scattering + ); + + material_surface surface = material_surface( + scattering: surface_bsdf_mix, + emission: emission_mix + ); + + //Back Surface + material_surface back_surface = material_surface( + scattering: bsdf(), + emission: material_emission( + emission: edf(), + intensity: color(0.0), + mode: intensity_radiant_exitance + ) + ); + + //Volume + // + vdf volume_vdf_mix = df::normalized_mix( + components: df::vdf_component[]( + df::vdf_component( + weight: (1.0 - blend_weight), + component: base_material.volume.scattering + ), + + df::vdf_component( + weight: blend_weight, + component: blend_material.volume.scattering + ) + ) + ); + + color volume_scattering_coefficient_mix = base::blend_color_layers( + base: base_material.volume.scattering_coefficient, + layers: base::color_layer[]( + base::color_layer( + layer_color: blend_material.volume.scattering_coefficient, + weight: blend_weight, + mode: base::color_layer_blend + ) + ) + ).tint; + + color volume_absorption_coefficient_mix = base::blend_color_layers( + base: base_material.volume.absorption_coefficient, + layers: base::color_layer[]( + base::color_layer( + layer_color: blend_material.volume.absorption_coefficient, + weight: blend_weight, + mode: base::color_layer_blend + ) + ) + ).tint; + + material_volume volume = (base_material.thin_walled || blend_material.thin_walled) ? + material_volume() : + material_volume( + scattering: volume_vdf_mix, + scattering_coefficient: volume_scattering_coefficient_mix, + absorption_coefficient: volume_absorption_coefficient_mix + ); + + //Geometry + // + color base_material_displacement(base_material.geometry.displacement); + color blend_material_displacement(blend_material.geometry.displacement); + color displacement_blend_as_color = base::blend_color_layers( + base: base_material_displacement, + layers: base::color_layer[]( + base::color_layer( + layer_color: blend_material_displacement, + weight: blend_weight, + mode: base::color_layer_blend + ) + ) + ).tint; + float3 displacement_blend(displacement_blend_as_color); + + color base_material_cutout_opacity(base_material.geometry.cutout_opacity); + color blend_material_cutout_opacity(blend_material.geometry.cutout_opacity); + float cutout_opacity_blend = base::blend_color_layers( + base: base_material_cutout_opacity, + layers: base::color_layer[]( + base::color_layer( + layer_color: blend_material_cutout_opacity, + weight: blend_weight, + mode: base::color_layer_blend + ) + ) + ).mono; + + float3 normal_blend = OmniShared::add_detail_normal( + base_material.geometry.normal, + blend_material.geometry.normal + ); + + material_geometry geometry = material_geometry( + displacement: displacement_blend, + cutout_opacity: enable_opacity ? + geometry_opacity_threshold == 0.0f ? + cutout_opacity_blend : + (cutout_opacity_blend >= geometry_opacity_threshold ? 1.0f : 0.0f) : + 1.0f, + normal: normal_blend + ); + +} in material( + thin_walled: (base_material.thin_walled || blend_material.thin_walled), + ior: base_material.ior, + surface: surface, + backface: back_surface, + volume: volume, + geometry: geometry +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceLiteBase.mdl b/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceLiteBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..55feec3b9c942bc323183e570ccb764de9277a2b --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurface/OmniSurfaceLiteBase.mdl @@ -0,0 +1,484 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +// Implementation of OmniSurfaceLiteBase material + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::limits::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +import OmniShared::*; + +export material OmniSurfaceLiteBase( + + //Diffuse reflection + // + float diffuse_reflection_weight = float(0.8) [[ + anno::display_name("Weight"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + color diffuse_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Base") + ]], + + float diffuse_reflection_roughness = float(0.0) [[ + anno::display_name("Diffuse Roughness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + //Metalness + // + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + //Specular reflection + // + float specular_reflection_weight = float(1.0) [[ + anno::display_name("Weight"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + color specular_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Specular") + ]], + + float specular_reflection_roughness = float(0.2) [[ + anno::display_name("Roughness"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::ior_presets specular_reflection_ior_preset = + OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Specular") + ]], + + uniform float specular_reflection_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Specular"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float specular_reflection_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + float specular_reflection_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Specular"), + anno::soft_range(0.0f, 1.0f) + ]], + + //Coat + // + float coat_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + color coat_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Coat") + ]], + + float coat_roughness = float(0.1) [[ + anno::display_name("Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::ior_presets coat_ior_preset = + OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Coat") + ]], + + uniform float coat_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Coat"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(1.0f, limits::FLOAT_MAX) + ]], + + float coat_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + float coat_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Coat"), + anno::soft_range(0.0f, 1.0f) + ]], + + float coat_affect_color = float(0.0) [[ + anno::display_name("Affect Color"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + float coat_affect_roughness = float(0.0) [[ + anno::display_name("Affect Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + float3 coat_normal = state::normal() [[ + anno::display_name("Normal"), + anno::in_group("Coat"), + anno::usage("normal") + ]], + + //Emission + // + float emission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Emission"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform OmniShared::emission_mode emission_mode = + OmniShared::emission_lx [[ + anno::display_name("Emission Mode"), + anno::in_group("Emission") + ]], + + float emission_intensity = float(1.0) [[ + anno::display_name("Intensity"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 1000.0f) + ]], + + color emission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Emission") + ]], + + uniform bool emission_use_temperature = false [[ + anno::display_name("Use Temperature"), + anno::in_group("Emission") + ]], + + float emission_temperature = float(6500.0) [[ + anno::display_name("Temperature (kelvin)"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 10000.0f) + ]], + + //Geometry + // + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Geometry") + ]], + + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float geometry_opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float geometry_normal_roughness_strength = float(1.0) [[ + anno::display_name("Geometry Normal Roughness Strength"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + float2 geometry_normal_roughness = float2(0.0) [[ + anno::display_name("Geometry Normal Roughness"), + anno::in_group("Geometry") + ]], + + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + float3 geometry_displacement = float3(0.0) [[ + anno::display_name("Displacement"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniSurfaceLiteBase"), + anno::description("A base material for modeling a variety of surfaces."), + anno::in_group("Omni Materials", "OmniSurface"), + anno::author("NVIDIA Corporation"), + anno::key_words(string[]("generic", "surface")), + anno::thumbnail(".thumbs/OmniSurfaceLiteBase.png"), + anno::version(1, 0, 0, "") + +]] = let { + + //Coat - Dielectric microfacet BRDF + float coat_roughness_2 = coat_roughness * coat_roughness; + float2 coat_roughness_anisotropy = + coat_anisotropy != 0.0f ? + OmniShared::compute_anisotropy(coat_roughness_2, coat_anisotropy): + float2(coat_roughness_2); + + float coat_roughness_u = coat_roughness_anisotropy.x; + float coat_roughness_v = coat_roughness_anisotropy.y; + float3 coat_tangent_u = + coat_roughness_anisotropy != 0.0f ? + coat_anisotropy_rotation != 0.0f ? + OmniShared::rotate_tangent( + state::texture_tangent_u(0), + coat_anisotropy_rotation): + state::texture_tangent_u(0): + state::texture_tangent_u(0); + + float coat_ior_value = OmniShared::ior_preset_to_value( + coat_ior_preset, + coat_ior); + + OmniShared::fresnel_reflectivity coat_fresnel_reflectivity = + OmniShared::approximate_fresnel( + coat_ior_value, + coat_roughness_2); + + color coat_multiscatter_tint = color(0.92); //heuristic + + bsdf coat_brdf = df::microfacet_ggx_smith_bsdf( + roughness_u: coat_roughness_u, + roughness_v: coat_roughness_v, + tint: color(1.0), + multiscatter_tint: coat_multiscatter_tint, + tangent_u: coat_tangent_u, + mode: df::scatter_reflect); + + //Specular reflection - Dielectric microfacet BRDF + float specular_reflection_roughness_2 = + specular_reflection_roughness * specular_reflection_roughness; + + float coat_affect_roughness_coefficient = + (coat_weight * coat_roughness_2 * coat_affect_roughness); + + float specular_reflection_roughness_coefficient = + math::lerp(specular_reflection_roughness_2, 1.0f, coat_affect_roughness_coefficient); + + float2 specular_reflection_roughness_anisotropy = + specular_reflection_anisotropy != 0.0f ? + OmniShared::compute_anisotropy( + specular_reflection_roughness_coefficient, + specular_reflection_anisotropy): + float2(specular_reflection_roughness_coefficient); + + float specular_reflection_roughness_u = + specular_reflection_roughness_anisotropy.x + + geometry_normal_roughness.x * geometry_normal_roughness.x * geometry_normal_roughness_strength; + + float specular_reflection_roughness_v = + specular_reflection_roughness_anisotropy.y + + geometry_normal_roughness.y * geometry_normal_roughness.y * geometry_normal_roughness_strength; + + float3 specular_reflection_tangent_u = + specular_reflection_roughness_anisotropy != 0.0f ? + specular_reflection_anisotropy_rotation != 0.0f ? + OmniShared::rotate_tangent( + state::texture_tangent_u(0), + specular_reflection_anisotropy_rotation): + state::texture_tangent_u(0): + state::texture_tangent_u(0); + + float specular_reflection_ior_value = OmniShared::ior_preset_to_value( + specular_reflection_ior_preset, + specular_reflection_ior); + + OmniShared::fresnel_reflectivity specular_reflection_fresnel_reflectivity = + OmniShared::approximate_fresnel( + specular_reflection_ior_value, + specular_reflection_roughness_2); + + color specular_reflection_multiscatter_tint = + specular_reflection_color * color(0.92); //heuristic + + bsdf specular_reflection_brdf = df::microfacet_ggx_smith_bsdf( + roughness_u: specular_reflection_roughness_u, + roughness_v: specular_reflection_roughness_v, + tint: specular_reflection_color, + multiscatter_tint: specular_reflection_multiscatter_tint, + tangent_u: specular_reflection_tangent_u, + mode: df::scatter_reflect); + + //Metal - Conductor microfacet BRDF + float metal_roughness_u = specular_reflection_roughness_u; + float metal_roughness_v = specular_reflection_roughness_v; + float3 metal_tangent_u = specular_reflection_tangent_u; + + color metal_multiscatter_tint = color(1.0); + + bsdf metal_base_brdf = df::microfacet_ggx_smith_bsdf( + roughness_u: metal_roughness_u, + roughness_v: metal_roughness_v, + tint: color(1.0), + multiscatter_tint: metal_multiscatter_tint, + tangent_u: metal_tangent_u, + mode: df::scatter_reflect); + + color metal_base_color = diffuse_reflection_color * diffuse_reflection_weight; + color metal_edge_color = specular_reflection_color * specular_reflection_weight; + OmniShared::metal_complex_ior metal_ior = + OmniShared::compute_artistic_to_conductor_fresnel( + metal_base_color, + metal_edge_color); + + bsdf metal_brdf = df::fresnel_factor( + ior: metal_ior.n, + extinction_coefficient: metal_ior.k, + base: metal_base_brdf); + + //Diffuse reflection - Diffuse microfacet BRDF + float coat_gamma = 1.0f + coat_affect_color * math::clamp(coat_weight, 0.0f, 1.0f); + color diffuse_color = + math::pow(diffuse_reflection_color * diffuse_reflection_weight, coat_gamma); + + bsdf diffuse_reflection_bsdf = df::diffuse_reflection_bsdf( + tint: diffuse_color, + roughness: diffuse_reflection_roughness); + + //Emission - Diffuse emission + uniform float emission_unit_intensity = + (emission_mode == OmniShared::emission_lx) ? + 1.0f : + math::PI; + + color emission_coat_affect = math::lerp(color(1.0), coat_color, coat_weight); + + color emission_final_color = + emission_use_temperature ? + math::blackbody(emission_temperature): + emission_color; + + color emission_final_intensity = + emission_weight * emission_intensity * emission_unit_intensity * + emission_final_color * emission_coat_affect; + + material_emission emission = material_emission( + emission: + df::directional_factor( + normal_tint: math::lerp( + color(1.0), + color(1.0 - coat_fresnel_reflectivity.nr), + coat_weight + ), + grazing_tint: math::lerp( + color(1.0), + color(1.0 - coat_fresnel_reflectivity.gr), + coat_weight + ), + exponent: 4.0f, //heuristic + base: df::diffuse_edf() + ), + intensity: emission_final_intensity, + mode: intensity_radiant_exitance); + + //Layering + // + //Diffuse reflection | Specular reflection + bsdf specular_reflection_brdf_mix = df::custom_curve_layer( + weight: specular_reflection_weight, + normal: geometry_normal, + normal_reflectivity: specular_reflection_fresnel_reflectivity.nr, + grazing_reflectivity: specular_reflection_fresnel_reflectivity.gr, + exponent: 4.0f, //heuristic + base: df::weighted_layer( + weight: 1.0f, + normal: geometry_normal, + base: bsdf(), + layer: diffuse_reflection_bsdf + ), + layer: specular_reflection_brdf + ); + + //Specular reflection | Metal + bsdf metal_brdf_mix = df::weighted_layer( + weight: metalness, + normal: geometry_normal, + base: specular_reflection_brdf_mix, + layer: metal_brdf + ); + + //Metal | Coat + bsdf coat_brdf_mix = df::custom_curve_layer( + normal_reflectivity: coat_fresnel_reflectivity.nr, + grazing_reflectivity: coat_fresnel_reflectivity.gr, + weight: coat_weight, + layer: coat_brdf, + base: df::tint( + tint: math::lerp(color(1.0), coat_color, coat_weight), + base: metal_brdf_mix + ), + normal: coat_normal + ); + + //Surface + material_surface surface = material_surface( + scattering: coat_brdf_mix, + emission: emission + ); + + //Back Surface + material_surface back_surface = material_surface( + scattering: bsdf(), + emission: material_emission( + emission: edf(), + intensity: color(0.0), + mode: intensity_radiant_exitance + ) + ); + + //Volume + material_volume volume = material_volume(); + + //Geometry + material_geometry geometry = material_geometry( + displacement: geometry_displacement, + cutout_opacity: enable_opacity ? + geometry_opacity_threshold == 0.0f ? + geometry_opacity : + (geometry_opacity >= geometry_opacity_threshold ? 1.0f : 0.0f) : + 1.0f, + normal: state::normal() + ); + +} in material( + thin_walled: false, + ior: color(1.0f), + surface: surface, + backface: back_surface, + volume: volume, + geometry: geometry +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurfaceLite.mdl b/unitree_z1/materials/mdl/OmniSurfaceLite.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a0d74fae12413f8deaad1d37240969c1c9eb4a3a --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurfaceLite.mdl @@ -0,0 +1,1164 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// Wrapper for OmniSurfaceLiteBase material + +mdl 1.7; + +import ::anno::*; +import ::base::*; +import ::limits::*; +import ::state::*; +import ::tex::*; + +import OmniSurface::OmniSurfaceLiteBase::*; +import OmniSurface::OmniShared::*; +import OmniSurface::OmniImage::*; + +export material OmniSurfaceLite( + + //Diffuse reflection + // + float diffuse_reflection_weight = float(0.8) [[ + anno::display_name("Weight"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d diffuse_reflection_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Base"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. +]], + + uniform OmniSurface::OmniImage::alpha_mode diffuse_reflection_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Base") + ]], + + color diffuse_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Base") + ]], + + uniform texture_2d diffuse_reflection_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Base") + ]], + + float diffuse_reflection_roughness = float(0.0) [[ + anno::display_name("Diffuse Roughness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d diffuse_reflection_roughness_image = texture_2d() [[ + anno::display_name("Diffuse Roughness Image"), + anno::in_group("Base"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode diffuse_reflection_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Diffuse Roughness Alpha Mode"), + anno::in_group("Base") + ]], + + //Metal + // + float metalness = float(0.0) [[ + anno::display_name("Metalness"), + anno::in_group("Base"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d metalness_image = texture_2d() [[ + anno::display_name("Metalness Image"), + anno::in_group("Base"), + anno::usage("metalness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode metalness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Metalness Image Alpha Mode"), + anno::in_group("Base") + ]], + + //Specular reflection + // + float specular_reflection_weight = float(1.0) [[ + anno::display_name("Weight"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Specular"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Specular") + ]], + + color specular_reflection_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Specular") + ]], + + uniform texture_2d specular_reflection_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Specular") + ]], + + float specular_reflection_roughness = float(0.2) [[ + anno::display_name("Roughness"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_roughness_image = texture_2d() [[ + anno::display_name("Roughness Image"), + anno::in_group("Specular"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Roughness Image Alpha Mode"), + anno::in_group("Specular") + ]], + + uniform OmniSurface::OmniShared::ior_presets specular_reflection_ior_preset = + OmniSurface::OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Specular") + ]], + + uniform float specular_reflection_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Specular"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float specular_reflection_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Specular"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_anisotropy_image = texture_2d() [[ + anno::display_name("Anisotropy Image"), + anno::in_group("Specular"), + anno::usage("aniotropy") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Image Alpha Mode"), + anno::in_group("Specular") + ]], + + float specular_reflection_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Specular"), + anno::soft_range(0.0f, 1.0f) + ]], + + uniform texture_2d specular_reflection_anisotropy_rotation_image = texture_2d() [[ + anno::display_name("Anisotropy Rotation Image"), + anno::in_group("Specular"), + anno::usage("anisotropy_rotation") + ]], + + uniform OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_rotation_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Rotation Alpha Mode"), + anno::in_group("Specular") + ]], + + //Coat + // + float coat_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Coat"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Coat") + ]], + + color coat_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Coat") + ]], + + uniform texture_2d coat_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Coat") + ]], + + float coat_roughness = float(0.1) [[ + anno::display_name("Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_roughness_image = texture_2d() [[ + anno::display_name("Roughness Image"), + anno::in_group("Coat"), + anno::usage("roughness") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Roughness Image Alpha Mode"), + anno::in_group("Coat") + ]], + + uniform OmniSurface::OmniShared::ior_presets coat_ior_preset = + OmniSurface::OmniShared::ior_custom [[ + anno::display_name("IOR Preset"), + anno::in_group("Coat") + ]], + + uniform float coat_ior = float(1.5) [[ + anno::display_name("IOR"), + anno::in_group("Coat"), + anno::soft_range(1.0f, 5.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float coat_anisotropy = float(0.0) [[ + anno::display_name("Anisotropy"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_anisotropy_image = texture_2d() [[ + anno::display_name("Anisotropy Image"), + anno::in_group("Coat"), + anno::usage("anisotropy") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_anisotropy_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Image Alpha Mode"), + anno::in_group("Coat") + ]], + + float coat_anisotropy_rotation = float(0.0) [[ + anno::display_name("Rotation (radian)"), + anno::in_group("Coat"), + anno::soft_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_anisotropy_rotation_image = texture_2d() [[ + anno::display_name("Anisotropy Rotation Image"), + anno::in_group("Coat"), + anno::usage("anistropy_rotation") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_anisotropy_rotation_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Anisotropy Rotation Image Alpha Mode"), + anno::in_group("Coat") + ]], + + float coat_affect_color = float(0.0) [[ + anno::display_name("Affect Color"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_affect_color_image = texture_2d() [[ + anno::display_name("Affect Color Image"), + anno::in_group("Coat") + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_affect_color_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Affect Color Image Alpha Mode"), + anno::in_group("Coat") + ]], + + float coat_affect_roughness = float(0.0) [[ + anno::display_name("Affect Roughness"), + anno::in_group("Coat"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d coat_affect_roughness_image = texture_2d() [[ + anno::display_name("Affect Roughness Image"), + anno::in_group("Coat"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode coat_affect_roughness_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Affect Roughness Alpha Mode"), + anno::in_group("Coat") + ]], + + uniform float coat_normal_strength = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::in_group("Coat"), + anno::soft_range(0.0f, 1.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + float3 coat_normal = state::normal() [[ + anno::display_name("Normal"), + anno::in_group("Coat"), + anno::usage("normal") + ]], + + uniform texture_2d coat_normal_image = texture_2d() [[ + anno::display_name("Normal Map Image"), + anno::in_group("Coat"), + anno::usage("normal") + ]], + + uniform bool coat_normal_image_flip_r_channel = false [[ + anno::display_name("Normal Map Flip R Channel"), + anno::in_group("Coat") + ]], + + uniform bool coat_normal_image_flip_g_channel = false [[ + anno::display_name("Normal Map Flip G Channel"), + anno::in_group("Coat") + ]], + + uniform bool coat_normal_image_flip_b_channel = false [[ + anno::display_name("Normal Map Flip B Channel"), + anno::in_group("Coat") + ]], + + //Emission + // + float emission_weight = float(0.0) [[ + anno::display_name("Weight"), + anno::in_group("Emission"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d emission_weight_image = texture_2d() [[ + anno::display_name("Weight Image"), + anno::in_group("Emission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode emission_weight_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Weight Image Alpha Mode"), + anno::in_group("Emission") + ]], + + uniform OmniSurface::OmniShared::emission_mode emission_mode = + OmniSurface::OmniShared::emission_lx + [[ + anno::display_name("Emission Mode"), + anno::in_group("Emission") + ]], + + float emission_intensity = float(1.0) [[ + anno::display_name("Intensity"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 1000.0f) + ]], + + uniform texture_2d emission_intensity_image = texture_2d() [[ + anno::display_name("Intensity Image"), + anno::in_group("Emission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode emission_intensity_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Intensity Image Alpha Mode"), + anno::in_group("Emission") + ]], + + color emission_color = color(1.0) [[ + anno::display_name("Color"), + anno::in_group("Emission") + ]], + + uniform texture_2d emission_color_image = texture_2d() [[ + anno::display_name("Color Image"), + anno::in_group("Emission") + ]], + + uniform bool emission_use_temperature = false [[ + anno::display_name("Use Temperature"), + anno::in_group("Emission") + ]], + + float emission_temperature = float(6500.0) [[ + anno::display_name("Temperature (kelvin)"), + anno::in_group("Emission"), + anno::soft_range(0.0f, 10000.0f) + ]], + + uniform texture_2d emission_temperature_image = texture_2d() [[ + anno::display_name("Temperature Image"), + anno::in_group("Emission"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode emission_temperature_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Temperature Image Alpha Mode"), + anno::in_group("Emission") + ]], + + //Geometry + // + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Geometry") + ]], + + float geometry_opacity = float(1.0) [[ + anno::display_name("Opacity"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform texture_2d geometry_opacity_image = texture_2d() [[ + anno::display_name("Opacity Image"), + anno::in_group("Geometry"), + anno::usage("opacity") + ]], + + uniform OmniSurface::OmniImage::alpha_mode geometry_opacity_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Opacity Image Alpha Mode"), + anno::in_group("Geometry") + ]], + + uniform float geometry_opacity_threshold = float(0.0) [[ + anno::display_name("Opacity Threshold"), + anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + uniform float geometry_normal_strength = float(1.0) [[ + anno::display_name("Geometry Normal Strength"), + anno::in_group("Geometry"), + anno::soft_range(0.0f, 1.0f), + anno::hard_range(0.0f, limits::FLOAT_MAX) + ]], + + uniform float geometry_normal_roughness_strength = float(1.0) [[ + anno::display_name("Geometry Normal Roughness Strength"), + anno::in_group("Geometry"), + anno::hard_range(0.0f, 1.0f) + ]], + + float3 geometry_normal = state::normal() [[ + anno::display_name("Geometry Normal"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + uniform texture_2d geometry_normal_image = texture_2d() [[ + anno::display_name("Geometry Normal Map Image"), + anno::in_group("Geometry"), + anno::usage("normal") + ]], + + uniform bool geometry_normal_image_flip_r_channel = false [[ + anno::display_name("Normal Map Flip R Channel"), + anno::in_group("Geometry") + ]], + + uniform bool geometry_normal_image_flip_g_channel = false [[ + anno::display_name("Normal Map Flip G Channel"), + anno::in_group("Geometry") + ]], + + uniform bool geometry_normal_image_flip_b_channel = false [[ + anno::display_name("Normal Map Flip B Channel"), + anno::in_group("Geometry") + ]], + + uniform OmniSurface::OmniImage::tangent_bitangent_mapping geometry_tangent_bitangent_mapping = + OmniSurface::OmniImage::red_green [[ + anno::display_name("Tangent Bitangent Mapping"), + anno::in_group("Geometry") + ]], + + //Displacement + float3 geometry_displacement = float3(0.0) [[ + anno::display_name("Displacement"), + anno::in_group("Geometry") + ]], + + uniform OmniSurface::OmniShared::displacement_mode geometry_displacement_mode = + OmniSurface::OmniShared::displacement_height [[ + anno::display_name("Displacement Mode"), + anno::in_group("Geometry") + ]], + + uniform texture_2d geometry_displacement_image = texture_2d() [[ + anno::display_name("Displacement Image"), + anno::in_group("Geometry"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode geometry_displacement_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Displacement Image Alpha Mode"), + anno::in_group("Geometry") + ]], + + float geometry_displacement_scale = float(1.0) [[ + anno::display_name("Displacement Scale"), + anno::in_group("Geometry"), + anno::soft_range(0.0f, 1.0f) + ]], + + uniform texture_2d geometry_displacement_scale_image = texture_2d() [[ + anno::display_name("Displacement Scale Image"), + anno::in_group("Geometry"), + anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now. + ]], + + uniform OmniSurface::OmniImage::alpha_mode geometry_displacement_scale_image_alpha_mode = + OmniSurface::OmniImage::alpha_default [[ + anno::display_name("Displacement Scale Image Alpha Mode"), + anno::in_group("Geometry") + ]], + + float geometry_displacement_scalar_zero_value = float(0.0) [[ + anno::display_name("Displacement Scalar Zero Value"), + anno::in_group("Geometry"), + anno::soft_range(0.0f, 1.0f) + ]], + + //UVW + // + uniform base::texture_coordinate_system uvw_texture_coordinate_system = + base::texture_coordinate_uvw [[ + anno::display_name("Texture Coordinate"), + anno::in_group("UVW Coordinates") + ]], + + uniform int uvw_uv_set = 0 [[ + anno::display_name("UV Set"), + anno::in_group("UVW Coordinates"), + anno::hard_range(0, 4) + ]], + + uniform bool uvw_ignore_missing_textures = false [[ + anno::display_name("Ignore Missing Images"), + anno::in_group("UVW Coordinates") + ]], + + color uvw_missing_texture_color = color(0.0, 0.0, 0.0) [[ + anno::display_name("Missing Image Color"), + anno::in_group("UVW Coordinates") + ]], + + uniform bool uvw_use_uv_coords = false [[ + anno::display_name("Use UV Coords"), + anno::in_group("UVW Coordinates") + ]], + + float2 uvw_uv_coords = float2(0.0) [[ + anno::display_name("UV Coords"), + anno::in_group("UVW Coordinates") + ]], + + uniform float uvw_s_offset = 0.0f [[ + anno::display_name("Offset U"), + anno::in_group("UVW Coordinates"), + anno::soft_range(-1.0f, 1.0f) + ]], + + uniform float uvw_t_offset = 0.0f [[ + anno::display_name("Offset V"), + anno::in_group("UVW Coordinates"), + anno::soft_range(-1.0f, 1.0f) + ]], + + uniform OmniSurface::OmniImage::wrap_mode uvw_s_wrap = + OmniSurface::OmniImage::wrap_periodic [[ + anno::display_name("Wrap U"), + anno::in_group("UVW Coordinates") + ]], + + uniform OmniSurface::OmniImage::wrap_mode uvw_t_wrap = + OmniSurface::OmniImage::wrap_periodic [[ + anno::display_name("Wrap V"), + anno::in_group("UVW Coordinates") + ]], + + uniform float uvw_s_scale = 1.0f [[ + anno::display_name("Scale U"), + anno::in_group("UVW Coordinates"), + anno::soft_range(0.0f, 100.0f) + ]], + + uniform float uvw_t_scale = 1.0f [[ + anno::display_name("Scale V"), + anno::in_group("UVW Coordinates"), + anno::soft_range(0.0f, 100.0f) + ]], + + uniform bool uvw_s_flip = false [[ + anno::display_name("Flip U"), + anno::in_group("UVW Coordinates") + ]], + + uniform bool uvw_t_flip = false [[ + anno::display_name("Flip V"), + anno::in_group("UVW Coordinates") + ]], + + uniform bool uvw_swap_st = false [[ + anno::display_name("Swap UV"), + anno::in_group("UVW Coordinates") + ]], + + //Projection Coordinates (Local / World) + uniform OmniSurface::OmniImage::projection_mode uvw_projection_mode = + OmniSurface::OmniImage::projection_cubic [[ + anno::display_name("Projection Mode"), + anno::in_group("UVW Coordinates") + ]], + + uniform float3 uvw_projection_translate = float3(0.0) [[ + anno::display_name("Translate"), + anno::description("Translate the projected texture."), + anno::in_group("UVW Coordinates") + ]], + + uniform float3 uvw_projection_rotate = float3(0.0) [[ + anno::display_name("Rotate"), + anno::description("Rotate the projected texture."), + anno::in_group("UVW Coordinates") + ]], + + uniform float3 uvw_projection_scale = float3(1.0) [[ + anno::display_name("Scale"), + anno::description("Scale the projected texture."), + anno::in_group("UVW Coordinates") + ]] +) +[[ + anno::display_name("OmniSurfaceLite"), + anno::description("A base material for modeling a variety of surfaces."), + anno::author("NVIDIA Corporation"), + anno::key_words(string[]("generic", "surface")), + anno::version(1, 0, 0, ""), + anno::in_group("Advanced") +]] = let { + + base::texture_coordinate_info texture_coordinate_info = + OmniSurface::OmniImage::compute_texture_coordinate_2( + uvw_texture_coordinate_system, + uvw_uv_set, + uvw_s_offset, + uvw_t_offset, + uvw_s_scale, + uvw_t_scale, + uvw_s_flip, + uvw_t_flip, + uvw_swap_st, + uvw_projection_mode, + uvw_projection_translate, + uvw_projection_rotate, + uvw_projection_scale); + + OmniSurface::OmniImage::normal_roughness_data geometry_normal_roughness_data = + tex::texture_isvalid(geometry_normal_image) ? + OmniSurface::OmniImage::tangent_space_normal_roughness_lookup_2( + geometry_normal_image, + uvw_ignore_missing_textures, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + uvw_s_flip, + uvw_t_flip, + geometry_normal_strength, + geometry_normal_image_flip_r_channel, + geometry_normal_image_flip_g_channel, + geometry_normal_image_flip_b_channel, + texture_coordinate_info + ) : + OmniSurface::OmniImage::normal_roughness_data(geometry_normal, float2(0.0)); + + material base = OmniSurface::OmniSurfaceLiteBase::OmniSurfaceLiteBase ( + + //Base + // + diffuse_reflection_weight: tex::texture_isvalid(diffuse_reflection_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + diffuse_reflection_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + diffuse_reflection_weight_image_alpha_mode + ).mono : + diffuse_reflection_weight, + + diffuse_reflection_color: tex::texture_isvalid(diffuse_reflection_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + diffuse_reflection_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + diffuse_reflection_color, + + diffuse_reflection_roughness: tex::texture_isvalid(diffuse_reflection_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + diffuse_reflection_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + diffuse_reflection_roughness_image_alpha_mode + ).mono : + diffuse_reflection_roughness, + + //Metalness + // + metalness: tex::texture_isvalid(metalness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + metalness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + metalness_image_alpha_mode + ).mono : + metalness, + + //Specular reflection + // + specular_reflection_weight: tex::texture_isvalid(specular_reflection_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_weight_image_alpha_mode + ).mono : + specular_reflection_weight, + + specular_reflection_color: tex::texture_isvalid(specular_reflection_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + specular_reflection_color, + + specular_reflection_roughness: tex::texture_isvalid(specular_reflection_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_roughness_image_alpha_mode + ).mono : + specular_reflection_roughness, + + specular_reflection_ior_preset: specular_reflection_ior_preset, + specular_reflection_ior: specular_reflection_ior, + + specular_reflection_anisotropy: tex::texture_isvalid(specular_reflection_anisotropy_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_anisotropy_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_anisotropy_image_alpha_mode + ).mono : + specular_reflection_anisotropy, + + specular_reflection_anisotropy_rotation: tex::texture_isvalid( + specular_reflection_anisotropy_rotation_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + specular_reflection_anisotropy_rotation_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + specular_reflection_anisotropy_rotation_image_alpha_mode + ).mono : + specular_reflection_anisotropy_rotation, + + //Coat + // + coat_weight: tex::texture_isvalid(coat_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_weight_image_alpha_mode + ).mono : + coat_weight, + + coat_color: tex::texture_isvalid(coat_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + coat_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + coat_color, + + coat_roughness: tex::texture_isvalid(coat_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_roughness_image_alpha_mode + ).mono : + coat_roughness, + + coat_ior_preset: coat_ior_preset, + coat_ior: coat_ior, + + coat_anisotropy: tex::texture_isvalid(coat_anisotropy_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_anisotropy_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_anisotropy_image_alpha_mode + ).mono : + coat_anisotropy, + + coat_anisotropy_rotation: tex::texture_isvalid(coat_anisotropy_rotation_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_anisotropy_rotation_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_anisotropy_rotation_image_alpha_mode + ).mono : + coat_anisotropy_rotation, + + coat_affect_color: tex::texture_isvalid(coat_affect_color_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_affect_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_affect_color_image_alpha_mode + ).mono : + coat_affect_color, + + coat_affect_roughness: tex::texture_isvalid(coat_affect_roughness_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + coat_affect_roughness_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + coat_affect_roughness_image_alpha_mode + ).mono : + coat_affect_roughness, + + coat_normal: tex::texture_isvalid(coat_normal_image) ? + OmniSurface::OmniImage::normal_mapping( + OmniSurface::OmniImage::tangent_space_normal_lookup_2( + coat_normal_image, + uvw_ignore_missing_textures, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + uvw_s_flip, + uvw_t_flip, + coat_normal_strength, + coat_normal_image_flip_r_channel, + coat_normal_image_flip_g_channel, + coat_normal_image_flip_b_channel, + texture_coordinate_info + ), + geometry_tangent_bitangent_mapping, + coat_normal + ): + coat_normal, + + //Emission + // + emission_weight: tex::texture_isvalid(emission_weight_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + emission_weight_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + emission_weight_image_alpha_mode + ).mono : + emission_weight, + + emission_mode: emission_mode, + + emission_intensity: tex::texture_isvalid(emission_intensity_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + emission_intensity_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + emission_intensity_image_alpha_mode + ).mono : + emission_intensity, + + emission_color: tex::texture_isvalid(emission_color_image) ? + OmniSurface::OmniImage::texture_lookup_2( + emission_color_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint : + emission_color, + + emission_use_temperature: emission_use_temperature, + + emission_temperature: tex::texture_isvalid(emission_temperature_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + emission_temperature_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + emission_temperature_image_alpha_mode + ).mono : + emission_temperature, + + //Geometry + // + enable_opacity: enable_opacity, + + geometry_opacity: tex::texture_isvalid(geometry_opacity_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + geometry_opacity_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + geometry_opacity_image_alpha_mode + ).mono : + geometry_opacity, + + geometry_opacity_threshold: geometry_opacity_threshold, + + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + + geometry_normal_roughness: geometry_normal_roughness_data.roughness, + + geometry_normal: OmniSurface::OmniImage::normal_mapping( + geometry_normal_roughness_data.normal, + geometry_tangent_bitangent_mapping, + geometry_normal), + + geometry_displacement: tex::texture_isvalid(geometry_displacement_image) ? + OmniSurface::OmniShared::displacement_adjustment( + (geometry_displacement_mode == OmniSurface::OmniShared::displacement_height) ? + float3(OmniSurface::OmniImage::texture_adjustment_2( + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + geometry_displacement_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + geometry_displacement_image_alpha_mode + ), + 0.0f, //exposure + color(0.5), //default_color + color(1.0), //color_gain + color(0.0), //color_offset + 1.0f, //alpha_gain + -1.0f * geometry_displacement_scalar_zero_value, //alpha_offset + false, //invert + 0.0f //blend_factor + ).mono) : + + float3(OmniSurface::OmniImage::texture_lookup_2( + geometry_displacement_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ).tint + ), + + geometry_displacement_mode, + + tex::texture_isvalid(geometry_displacement_scale_image) ? + OmniSurface::OmniImage::texture_alpha_channel_remap_2( + OmniSurface::OmniImage::texture_lookup_2( + geometry_displacement_scale_image, + uvw_ignore_missing_textures, + uvw_missing_texture_color, + uvw_use_uv_coords, + uvw_uv_coords, + uvw_s_wrap, + uvw_t_wrap, + texture_coordinate_info + ), + geometry_displacement_scale_image_alpha_mode + ).mono : + geometry_displacement_scale + ): + geometry_displacement + ); + +} in material( + thin_walled: base.thin_walled, + ior: base.ior, + surface: base.surface, + backface: base.backface, + volume: base.volume, + geometry: base.geometry +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/OmniSurfacePresets.mdl b/unitree_z1/materials/mdl/OmniSurfacePresets.mdl new file mode 100644 index 0000000000000000000000000000000000000000..49d3669146e1ddbe845ab9b81d75862e8deb967b --- /dev/null +++ b/unitree_z1/materials/mdl/OmniSurfacePresets.mdl @@ -0,0 +1,5695 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::anno::*; +import ::limits::*; +import ::state::*; +import ::base::*; + +import OmniSurface::OmniShared::*; +import OmniSurface::OmniImage::*; +import OmniSurfaceLite::*; +import OmniSurface::*; + + +//Incandescent Bulb +// +export material OmniSurface_IncandescentBulb(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(1.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1000.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(0.944, 0.932, 0.760), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Brushed Metal +// +export material OmniSurface_BrushedMetal(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.5), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(1.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(0.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(0.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.25), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.5), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Chrome +// +export material OmniSurface_Chrome(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(1.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(0.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Copper +// +export material OmniSurface_Copper(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.93, 0.723, 0.503), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(1.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0, 0.956, 0.823), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.25), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Gold +// +export material OmniSurface_Gold(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.947, 0.776, 0.371), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(1.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0, 0.982, 0.753), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.15), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Foam +// +export material OmniSurface_Foam(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.2), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Rubber +// +export material OmniSurface_Rubber(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.229), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(1.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.6), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + + +//Car Paint +// +export material OmniSurface_CarPaint(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(0.5), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.104, 0.592, 0.851), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(1.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Car Paint Metallic +// +export material OmniSurface_CarPaintMetallic(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(0.8), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.044, 0.249, 0.357), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.5), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(0.08, 0.457, 0.656), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.4), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.5), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(1.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.55), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Glossy Paint +// +export material OmniSurface_GlossyPaint(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0, 0.0, 0.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0, 0.0, 0.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.4), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.5), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(1.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(2.0), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Two-tone Car Paint +// +export material OmniSurface_TwoToneCarPaint(*) = OmniSurfaceLite::OmniSurfaceLite( + diffuse_reflection_weight: float(0.8), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.012, 0.0, 0.157), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.370), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(0.5, 0.0, 1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.403), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.55), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(1.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.55), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//OmniSurface Default +// +export material OmniSurface_Default(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.8), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.2), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.5), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Peanut Butter +// +export material OmniSurface_PeanutButter(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.3), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(0.436, 0.279, 0.101), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.312, 0.632, 0.092), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.01), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Skim Milk +// +export material OmniSurface_SkimMilk(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.15), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_skim_milk, + subsurface_transmission_color: color(0.890, 0.890, 0.800), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(18.420, 10.440, 3.500), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.1), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Whole Milk +// +export material OmniSurface_WholeMilk(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.15), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_whole_milk, + subsurface_transmission_color: color(0.950, 0.930, 0.850), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(10.900, 6.580, 2.510), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.1), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Ceramic +// +export material OmniSurface_Ceramic(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(0.1), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Clay +// +export material OmniSurface_Clay(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.309, 0.05, 0.014), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.5), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.4), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(0.3), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(0.309, 0.05, 0.014), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(0.162), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Plastic +// +export material OmniSurface_Plastic(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.105, 0.242, 0.818), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.325), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(0.2), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(0.105, 0.242, 0.818), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.1), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Skin 1 +// +export material OmniSurface_Skin_1(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_skin_1, + subsurface_transmission_color: color(0.570, 0.310, 0.170), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(3.670, 1.370, 0.680), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.01), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.250), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.3), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.33), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Skin 2 +// +export material OmniSurface_Skin_2(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_skin_2, + subsurface_transmission_color: color(0.750, 0.570, 0.470), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(4.820, 1.690, 1.090), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.01), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.250), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.3), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.33), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Skin 3 +// +export material OmniSurface_Skin_3(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_skin_3, + subsurface_transmission_color: color(0.999, 0.615, 0.521), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.000, 0.300, 0.100), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.01), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.250), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.3), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.33), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Skin 4 +// +export material OmniSurface_Skin_4(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_skin_4, + subsurface_transmission_color: color(0.078, 0.043, 0.025), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(0.723, 0.264, 0.127), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.01), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.250), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.3), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.33), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Velvet +// +export material OmniSurface_Velvet(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.8), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.029, 0.0, 0.047), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(0.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: false, + specular_transmission_weight: float(0.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(1.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(0.404, 0.058, 1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Honey +// +export material OmniSurface_Honey(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.504), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0, 0.474, 0.115), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.1), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(1.0, 0.39, 0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Maple Syrup +// +export material OmniSurface_MapleSyrup(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.075), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.504), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.95, 0.35, 0.001), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.1), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.5, 0.1, 0.001), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Orange Juice +// +export material OmniSurface_OrangeJuice(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.831, 0.426, 0.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.4), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(0.3), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.999, 0.513, 0.001), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.1), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.999, 0.513, 0.001), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(0.831, 0.426, 0.001), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(0.162), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.1), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Dusted Glass +// +export material OmniSurface_DustedGlass(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(0.145, 0.640, 0.505), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.5), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(0.65), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.001, 0.2, 0.2), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.25), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.24, 0.54, 0.455), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(-0.5), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(1.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.5), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(1.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.55), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Frosted Glass +// +export material OmniSurface_FrostedGlass(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.4), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.713, 0.818, 0.814), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.292), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Glass +// +export material OmniSurface_Glass(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Blood +// +export material OmniSurface_Blood(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.432, 0.0, 0.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(0.1), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: true, + subsurface_weight: float(1.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(0.432, 0.0, 0.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(0.2), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.1), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Bubble +// +export material OmniSurface_Bubble(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.0), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(1.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.0), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: true, + thin_film_thickness: float(270.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.4), + + thin_walled: true, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Wax +// +export material OmniSurface_Wax(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0, 0.481, 0.864), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.4), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(0.8), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0, 0.481, 0.864), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(1.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(1.0, 0.481, 0.864), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0, 0.481, 0.864), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(2.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Polyethylene +// +export material OmniSurface_Polyethylene(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.1), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(1.52), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.95, 0.98, 1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(1.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.95, 0.98, 1.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: true, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Diamond +// +export material OmniSurface_Diamond(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.0), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_diamond, + specular_reflection_ior: float(2.42), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(20.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Jade +// +export material OmniSurface_Jade(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(1.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(0.060, 0.440, 0.192), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.250), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom, + specular_reflection_ior: float(2.418), + specular_reflection_anisotropy: float(0.5), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(0.6), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.060, 0.440, 0.192), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(1.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(0.060, 0.440, 0.192), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(0.1), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.1), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Clear Water +// +export material OmniSurface_ClearWater(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.12), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_water_0c, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(0.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.0), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.0), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); + +//Deep Water +// +export material OmniSurface_DeepWater(*) = OmniSurface::OmniSurface( + diffuse_reflection_weight: float(0.0), + diffuse_reflection_weight_image: texture_2d(), + diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + diffuse_reflection_color: color(1.0), + diffuse_reflection_color_image: texture_2d(), + diffuse_reflection_roughness: float(0.0), + diffuse_reflection_roughness_image: texture_2d(), + diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + metalness: float(0.0), + metalness_image: texture_2d(), + metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + specular_reflection_weight: float(1.0), + specular_reflection_weight_image: texture_2d(), + specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_color: color(1.0), + specular_reflection_color_image: texture_2d(), + specular_reflection_roughness: float(0.12), + specular_reflection_roughness_image: texture_2d(), + specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_ior_preset: OmniSurface::OmniShared::ior_water_0c, + specular_reflection_ior: float(1.33), + specular_reflection_anisotropy: float(0.0), + specular_reflection_anisotropy_image: texture_2d(), + specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_reflection_anisotropy_rotation: float(0.0), + specular_reflection_anisotropy_rotation_image: texture_2d(), + specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_specular_transmission: true, + specular_transmission_weight: float(1.0), + specular_transmission_weight_image: texture_2d(), + specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_color: color(0.744, 0.940, 1.0), + specular_transmission_color_image: texture_2d(), + specular_transmission_scattering_depth: float(1.0), + specular_transmission_scattering_depth_image: texture_2d(), + specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_scattering_color: color(0.067, 0.134, 0.5), + specular_transmission_scattering_color_image: texture_2d(), + specular_transmission_scatter_anisotropy: float(0.75), + specular_transmission_scatter_anisotropy_image: texture_2d(), + specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_transmission_dispersion_abbe: float(0.0), + + enable_diffuse_transmission: false, + subsurface_weight: float(0.0), + subsurface_weight_image: texture_2d(), + subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom, + subsurface_transmission_color: color(1.0), + subsurface_transmission_color_image: texture_2d(), + subsurface_scattering_color: color(1.0), + subsurface_scattering_color_image: texture_2d(), + subsurface_scale: float(1.0), + subsurface_scale_image: texture_2d(), + subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + subsurface_anisotropy: float(0.0), + subsurface_anisotropy_image: texture_2d(), + subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + coat_weight: float(0.0), + coat_weight_image: texture_2d(), + coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_color: color(1.0), + coat_color_image: texture_2d(), + coat_roughness: float(0.0), + coat_roughness_image: texture_2d(), + coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_ior_preset: OmniSurface::OmniShared::ior_custom, + coat_ior: float(1.5), + coat_anisotropy: float(0.0), + coat_anisotropy_image: texture_2d(), + coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_anisotropy_rotation: float(0.0), + coat_anisotropy_rotation_image: texture_2d(), + coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_color: float(0.0), + coat_affect_color_image: texture_2d(), + coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_affect_roughness: float(0.0), + coat_affect_roughness_image: texture_2d(), + coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + coat_normal_strength: float(1.0), + coat_normal: state::normal(), + coat_normal_image: texture_2d(), + coat_normal_image_flip_r_channel: false, + coat_normal_image_flip_g_channel: false, + coat_normal_image_flip_b_channel: false, + + specular_retro_reflection_weight: float(0.0), + specular_retro_reflection_weight_image: texture_2d(), + specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + specular_retro_reflection_color: color(1.0), + specular_retro_reflection_color_image: texture_2d(), + specular_retro_reflection_roughness: float(0.3), + specular_retro_reflection_roughness_image: texture_2d(), + specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + emission_weight: float(0.0), + emission_weight_image: texture_2d(), + emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_mode: OmniSurface::OmniShared::emission_lx, + emission_intensity: float(1.0), + emission_intensity_image: texture_2d(), + emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + emission_color: color(1.0), + emission_color_image: texture_2d(), + emission_use_temperature: false, + emission_temperature: float(6500.0), + emission_temperature_image: texture_2d(), + emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + + enable_thin_film: false, + thin_film_thickness: float(400.0), + thin_film_thickness_image: texture_2d(), + thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + thin_film_ior_preset: OmniSurface::OmniShared::ior_custom, + thin_film_ior: float(1.52), + + thin_walled: false, + enable_opacity: false, + geometry_opacity: float(1.0), + geometry_opacity_image: texture_2d(), + geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_opacity_threshold: float(0.0), + geometry_normal_strength: float(1.0), + geometry_normal_roughness_strength: float(1.0), + geometry_normal: state::normal(), + geometry_normal_image: texture_2d(), + geometry_normal_image_flip_r_channel: false, + geometry_normal_image_flip_g_channel: false, + geometry_normal_image_flip_b_channel: false, + geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green, + geometry_displacement: float3(0.0), + geometry_displacement_mode: OmniSurface::OmniShared::displacement_height, + geometry_displacement_image: texture_2d(), + geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scale: float(1.0), + geometry_displacement_scale_image: texture_2d(), + geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default, + geometry_displacement_scalar_zero_value: float(0.0), + + uvw_texture_coordinate_system: base::texture_coordinate_uvw, + uvw_uv_set: 0, + uvw_ignore_missing_textures: false, + uvw_missing_texture_color: color(0.0), + uvw_use_uv_coords: false, + uvw_uv_coords: float2(0.0), + uvw_s_offset: 0.0f, + uvw_t_offset: 0.0f, + uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic, + uvw_s_scale: 1.0f, + uvw_t_scale: 1.0f, + uvw_s_flip: false, + uvw_t_flip: false, + uvw_swap_st: false, + uvw_projection_mode: OmniSurface::OmniImage::projection_cubic, + uvw_projection_translate: float3(0.0), + uvw_projection_rotate: float3(0.0), + uvw_projection_scale: float3(1.0) +); \ No newline at end of file diff --git a/unitree_z1/materials/mdl/aux_definitions.mdl b/unitree_z1/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/unitree_z1/materials/mdl/aux_definitions.mdl @@ -0,0 +1,3464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::anno::*; +export using ::base import texture_return; + +module +[[ + anno::version( 1, 2, 0), + anno::hidden(), + anno::display_name("NVIDIA auxillary definitions") +]]; + +// Support functions to simplify conversions between vector types with swizzles +// Supported argument types: float2, float3, float4, color, texture_return (as RGB and RGBA) +// Supported return types: float, float2, float3 color + + +export annotation icon(string path); + + +//*********************************************************************************************************************** +// Constructor wrappers + +export float construct_float( + texture_return a [[ + anno::description("Input texture sample container; the mono channel is returned.") + ]]) +[[ + anno::display_name("Float from texture_return"), + anno::description("Constructs a float from the mono channel of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float"), + icon(".icons/constructor.svg"), + anno::ui_order(10000) +]] +{ return a.mono; } + +export color construct_color( + float a [[ + anno::description("Scalar value replicated into all color channels.") + ]]) +[[ + anno::display_name("Color from float"), + anno::description("Constructs a color from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10001) +]] +{ return color(a); } + +export color construct_color( + float3 a [[ + anno::description("RGB source components.") + ]]) +[[ + anno::display_name("Color from float3"), + anno::description("Constructs a color from a float3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10002) +]] +{ return color(a); } + +export color construct_color( + float r [[ + anno::description("Red channel value.") + ]], + float g [[ + anno::description("Green channel value.") + ]], + float b [[ + anno::description("Blue channel value.") + ]]) +[[ + anno::display_name("Color from floats"), + anno::description("Constructs a color from explicit red, green, and blue components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10003) +]] +{ return color(r,g,b); } + +export color construct_color( + texture_return a [[ + anno::description("Input texture sample container; the tint (RGB) channels are returned.") + ]]) +[[ + anno::display_name("Color from texture_return"), + anno::description("Constructs a color from the tint (RGB) channels of a texture_return value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Color"), + icon(".icons/constructor.svg"), + anno::ui_order(10004) +]] +{ return a.tint; } + +export float4 construct_float4( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from floats"), + anno::description("Constructs a float4 from explicit x, y, z, and w components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10005) +]] +{ return float4(x,y,z,w); } + +export float4 construct_float4( + float3 xyz [[ + anno::description("Source xyz components.") + ]], + float w [[ + anno::description("W component value.") + ]]) +[[ + anno::display_name("Float4 from float3,float"), + anno::description("Constructs a float4 from a float3 xyz value and a separate w component."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float4"), + icon(".icons/constructor.svg"), + anno::ui_order(10006) +]] +{ return float4(xyz.x,xyz.y,xyz.z,w); } + +export float3 construct_float3( + color a [[ + anno::description("Input color whose RGB channels are converted to float3.") + ]]) +[[ + anno::display_name("Float3 from color"), + anno::description("Constructs a float3 from a color value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10007) +]] +{ return float3(a); } + +export float3 construct_float3( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]], + float z [[ + anno::description("Z component value.") + ]]) +[[ + anno::display_name("Float3 from floats"), + anno::description("Constructs a float3 from explicit x, y, and z components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10008) +]] +{ return float3(x,y,z); } + +export float3 construct_float3( + int3 a [[ + anno::description("Input int3 converted component-wise to float3.") + ]]) +[[ + anno::display_name("Float3 from int3"), + anno::description("Constructs a float3 from an int3 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float3"), + icon(".icons/constructor.svg"), + anno::ui_order(10009) +]] +{ return float3(a); } + +export float2 construct_float2( + float a [[ + anno::description("Scalar value replicated into both components.") + ]]) +[[ + anno::display_name("Float2 from float"), + anno::description("Constructs a float2 from a single float value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10010) +]] +{ return float2(a); } + +export float2 construct_float2( + float x [[ + anno::description("X component value.") + ]], + float y [[ + anno::description("Y component value.") + ]]) +[[ + anno::display_name("Float2 from floats"), + anno::description("Constructs a float2 from explicit x and y components."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10011) +]] +{ return float2(x,y); } + +export float2 construct_float2( + int2 a [[ + anno::description("Input int2 converted component-wise to float2.") + ]]) +[[ + anno::display_name("Float2 from int2"), + anno::description("Constructs a float2 from an int2 value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Float2"), + icon(".icons/constructor.svg"), + anno::ui_order(10012) +]] +{ return float2(a); } + +export int3 construct_int3( + int a [[ + anno::description("Scalar value replicated into all int3 components.") + ]]) +[[ + anno::display_name("Int3 from int"), + anno::description("Constructs an int3 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int3"), + icon(".icons/constructor.svg"), + anno::ui_order(10013) +]] +{ return int3(a); } + +export int2 construct_int2( + int a [[ + anno::description("Scalar value replicated into both int2 components.") + ]]) +[[ + anno::display_name("Int2 from int"), + anno::description("Constructs an int2 from a single int value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constructor", "Int2"), + icon(".icons/constructor.svg"), + anno::ui_order(10014) +]] +{ return int2(a); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float return type + +export float x( float2 a) +[[ + anno::display_name("X from float2"), + anno::description("Returns x from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11000) +]] +{ return a.x; } + +export float y( float2 a) +[[ + anno::display_name("Y from float2"), + anno::description("Returns y from float2."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11010) +]] +{ return a.y; } + +export float x( float3 a) +[[ + anno::display_name("X from float3"), + anno::description("Returns x from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11001) +]] +{ return a.x; } + +export float y( float3 a) +[[ + anno::display_name("Y from float3"), + anno::description("Returns y from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11011) +]] +{ return a.y; } + +export float z( float3 a) +[[ + anno::display_name("Z from float3"), + anno::description("Returns z from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11020) +]] +{ return a.z; } + +export float x( float4 a) +[[ + anno::display_name("X from float4"), + anno::description("Returns x from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "X"), + icon(".icons/component_extract.svg"), + anno::ui_order(11002) +]] +{ return a.x; } + +export float y( float4 a) +[[ + anno::display_name("Y from float4"), + anno::description("Returns y from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Y"), + icon(".icons/component_extract.svg"), + anno::ui_order(11012) +]] +{ return a.y; } + +export float z( float4 a) +[[ + anno::display_name("Z from float4"), + anno::description("Returns z from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "Z"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return a.z; } + +export float w( float4 a) +[[ + anno::display_name("W from float4"), + anno::description("Returns w from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11025) +]] +{ return a.w; } + +export float x( color a) +[[ + anno::display_name("R from color"), + anno::description("Returns r from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11003) +]] +{ return x( float3(a)); } + +export float y( color a) +[[ + anno::display_name("G from color"), + anno::description("Returns g from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11013) +]] +{ return y( float3(a)); } + +export float z( color a) +[[ + anno::display_name("B from color"), + anno::description("Returns b from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11021) +]] +{ return z( float3(a)); } + +export float x( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("R from texture_return"), + anno::description("Returns r from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "R"), + icon(".icons/component_extract.svg"), + anno::ui_order(11004) +]] +{ return float3( a.tint).x; } + +export float y( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("G from texture_return"), + anno::description("Returns g from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "G"), + icon(".icons/component_extract.svg"), + anno::ui_order(11014) +]] +{ return float3( a.tint).y; } + +export float z( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("B from texture_return"), + anno::description("Returns b from texture_return tint."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "B"), + icon(".icons/component_extract.svg"), + anno::ui_order(11022) +]] +{ return float3( a.tint).z; } + +export float w( + texture_return a [[ + anno::description("Input texture sample container.") + ]]) +[[ + anno::display_name("Mono from texture_return"), + anno::description("Returns mono/alpha from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float", "W"), + icon(".icons/component_extract.svg"), + anno::ui_order(11026) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Conversions of texture_return +// All are hidden +export float4 texture_return_float4( + texture_return a [[ + anno::description("Input texture sample container to unpack as float4 (r, g, b, mono).") + ]]) +[[ + anno::display_name("float4 from texture_return"), + anno::description("Converts texture_return to float4 using tint RGB and mono as W."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float4"), + icon(".icons/component_extract.svg"), + anno::ui_order(10108) +]] +{ return float4(x(a),y(a),z(a),w(a)); } + +export float3 texture_return_float3( + texture_return a [[ + anno::description("Input texture sample container to unpack as float3 (r, g, b).") + ]]) +[[ + anno::display_name("float3 from texture_return"), + anno::description("Converts texture_return to float3 using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + icon(".icons/component_extract.svg"), + anno::ui_order(10109) +]] +{ return float3(x(a),y(a),z(a)); } + +export color texture_return_color( + texture_return a [[ + anno::description("Input texture sample container; tint RGB is returned as color.") + ]]) +[[ + anno::display_name("color from texture_return"), + anno::description("Converts texture_return to color using the tint RGB channels."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Color"), + icon(".icons/component_extract.svg"), + anno::ui_order(10110) +]] +{ return a.tint; } + +export float texture_return_float( + texture_return a [[ + anno::description("Input texture sample container; mono channel is returned.") + ]]) +[[ + anno::display_name("float from texture_return"), + anno::description("Converts texture_return to float using the mono channel."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float"), + icon(".icons/component_extract.svg"), + anno::ui_order(10111) +]] +{ return a.mono; } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float2 return type + +export float2 xy( float2 a) +[[ + anno::display_name("XY from float2"), + anno::description("Returns float2(x,y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11040) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float3 a) +[[ + anno::display_name("XY from float3"), + anno::description("Returns float2(x,y) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11041) +]] +{ return float2( a.x, a.y); } + +export float2 xy( float4 a) +[[ + anno::display_name("XY from float4"), + anno::description("Returns float2(x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return float2( a.x, a.y); } + +export float2 xy( color a) +[[ + anno::display_name("XY from color"), + anno::description("Returns float2(x,y) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return xy( float3(a)); } + +export float2 xy( + texture_return a [[ + anno::description("Input texture sample container; returns the first two tint channels.") + ]]) +[[ + anno::display_name("XY from texture_return"), + anno::description("Returns float2(r, g) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11044) +]] +{ return xy(texture_return_float4(a)); } + + +// The remaining are hidden +export float2 xx( float2 a) +[[ + anno::display_name("XX from float2"), + anno::description("Returns float2(x,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11030) +]] +{ return float2( a.x, a.x); } + +export float2 yx( float2 a) +[[ + anno::display_name("YX from float2"), + anno::description("Returns float2(y,x)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11050) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float2 a) +[[ + anno::display_name("YY from float2"), + anno::description("Returns float2(y,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11060) +]] +{ return float2( a.y, a.y); } + +export float2 xx( float3 a) +[[ + anno::display_name("XX from float3"), + anno::description("Returns float2(x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11031) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float3 a) +[[ + anno::display_name("XZ from float3"), + anno::description("Returns float2(x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11042) +]] +{ return float2( a.x, a.z); } + +export float2 yz( float3 a) +[[ + anno::display_name("YZ from float3"), + anno::description("Returns float2(y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11043) +]] +{ return float2( a.y, a.z); } + +export float2 yx( float3 a) +[[ + anno::display_name("YX from float3"), + anno::description("Returns float2(y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11051) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float3 a) +[[ + anno::display_name("YY from float3"), + anno::description("Returns float2(y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11061) +]] +{ return float2( a.y, a.y); } + +export float2 zx( float3 a) +[[ + anno::display_name("ZX from float3"), + anno::description("Returns float2(z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11090) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float3 a) +[[ + anno::display_name("ZY from float3"), + anno::description("Returns float2(z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11100) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float3 a) +[[ + anno::display_name("ZZ from float3"), + anno::description("Returns float2(z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11110) +]] +{ return float2( a.z, a.z); } + +export float2 xx( float4 a) +[[ + anno::display_name("XX from float4"), + anno::description("Returns float2(x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11032) +]] +{ return float2( a.x, a.x); } + +export float2 xz( float4 a) +[[ + anno::display_name("XZ from float4"), + anno::description("Returns float2(x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11071) +]] +{ return float2( a.x, a.z); } + +export float2 xw( float4 a) +[[ + anno::display_name("XW from float4"), + anno::description("Returns float2(x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11120) +]] +{ return float2( a.x, a.w); } + +export float2 yx( float4 a) +[[ + anno::display_name("YX from float4"), + anno::description("Returns float2(y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11052) +]] +{ return float2( a.y, a.x); } + +export float2 yy( float4 a) +[[ + anno::display_name("YY from float4"), + anno::description("Returns float2(y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11062) +]] +{ return float2( a.y, a.y); } + +export float2 yz( float4 a) +[[ + anno::display_name("YZ from float4"), + anno::description("Returns float2(y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11081) +]] +{ return float2( a.y, a.z); } + +export float2 yw( float4 a) +[[ + anno::display_name("YW from float4"), + anno::description("Returns float2(y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11125) +]] +{ return float2( a.y, a.w); } + +export float2 zx( float4 a) +[[ + anno::display_name("ZX from float4"), + anno::description("Returns float2(z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11091) +]] +{ return float2( a.z, a.x); } + +export float2 zy( float4 a) +[[ + anno::display_name("ZY from float4"), + anno::description("Returns float2(z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11101) +]] +{ return float2( a.z, a.y); } + +export float2 zz( float4 a) +[[ + anno::display_name("ZZ from float4"), + anno::description("Returns float2(z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11111) +]] +{ return float2( a.z, a.z); } + +export float2 zw( float4 a) +[[ + anno::display_name("ZW from float4"), + anno::description("Returns float2(z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11127) +]] +{ return float2( a.z, a.w); } + +export float2 wx( float4 a) +[[ + anno::display_name("WX from float4"), + anno::description("Returns float2(w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11129) +]] +{ return float2( a.w, a.x); } + +export float2 wy( float4 a) +[[ + anno::display_name("WX from loat4"), + anno::description("Returns float2(w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11131) +]] +{ return float2( a.w, a.y); } + +export float2 wz( float4 a) +[[ + anno::display_name("WZ from float4"), + anno::description("Returns float2(w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11133) +]] +{ return float2( a.w, a.z); } + +export float2 ww( float4 a) +[[ + anno::display_name("WW from float4"), + anno::description("Returns float2(w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11135) +]] +{ return float2( a.w, a.w); } + +export float2 xx( color a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11033) +]] +{ return xx( float3(a)); } + +export float2 xz( color a) +[[ + anno::display_name("XZ from color"), + anno::description("Returns float2(x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11072) +]] +{ return xz( float3(a)); } + +export float2 yx( color a) +[[ + anno::display_name("YX from color"), + anno::description("Returns float2(y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11053) +]] +{ return yx( float3(a)); } + +export float2 yy( color a) +[[ + anno::display_name("YY from color"), + anno::description("Returns float2(y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11063) +]] +{ return yy( float3(a)); } + +export float2 yz( color a) +[[ + anno::display_name("YZ from color"), + anno::description("Returns float2(y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11082) +]] +{ return yz( float3(a)); } + +export float2 zx( color a) +[[ + anno::display_name("ZX from color"), + anno::description("Returns float2(z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11092) +]] +{ return zx( float3(a)); } + +export float2 zy( color a) +[[ + anno::display_name("ZY from color"), + anno::description("Returns float2(z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11102) +]] +{ return zy( float3(a)); } + +export float2 zz( color a) +[[ + anno::display_name("ZZ from color"), + anno::description("Returns float2(z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11112) +]] +{ return zz( float3(a)); } + +export float2 xx( texture_return a) +[[ + anno::display_name("XX from color"), + anno::description("Returns float2(x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11034) +]] +{ return xx(texture_return_float4(a)); } + +export float2 xz( texture_return a) +[[ + anno::display_name("XZ from texture_return"), + anno::description("Returns float2(x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11073) +]] +{ return xz(texture_return_float4(a)); } + +export float2 xw( texture_return a) +[[ + anno::display_name("XW from texture_return"), + anno::description("Returns float2(x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11121) +]] +{ return xw(texture_return_float4(a)); } + +export float2 yx( texture_return a) +[[ + anno::display_name("YX from texture_return"), + anno::description("Returns float2(y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11054) +]] +{ return yx(texture_return_float4(a)); } + +export float2 yy( texture_return a) +[[ + anno::display_name("YY from texture_return"), + anno::description("Returns float2(y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11064) +]] +{ return yy(texture_return_float4(a)); } + +export float2 yz( texture_return a) +[[ + anno::display_name("YZ from texture_return"), + anno::description("Returns float2(y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11083) +]] +{ return yz(texture_return_float4(a)); } + +export float2 yw( texture_return a) +[[ + anno::display_name("YW from texture_return"), + anno::description("Returns float2(y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11126) +]] +{ return yw(texture_return_float4(a)); } + +export float2 zx( texture_return a) +[[ + anno::display_name("ZX from texture_return"), + anno::description("Returns float2(z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11093) +]] +{ return zx(texture_return_float4(a)); } + +export float2 zy( texture_return a) +[[ + anno::display_name("ZY from texture_return"), + anno::description("Returns float2(z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11103) +]] +{ return zy(texture_return_float4(a)); } + +export float2 zz( texture_return a) +[[ + anno::display_name("ZZ from texture_return"), + anno::description("Returns float2(z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11113) +]] +{ return zz(texture_return_float4(a)); } + +export float2 zw( texture_return a) +[[ + anno::display_name("ZW from texture_return"), + anno::description("Returns float2(z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11128) +]] +{ return zw(texture_return_float4(a)); } + +export float2 wx( texture_return a) +[[ + anno::display_name("WX from texture_return.WX"), + anno::description("Returns float2(w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11130) +]] +{ return wx(texture_return_float4(a)); } + +export float2 wy( texture_return a) +[[ + anno::display_name("WY from texture_return"), + anno::description("Returns float2(w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11132) +]] +{ return wy(texture_return_float4(a)); } + +export float2 wz( texture_return a) +[[ + anno::display_name("WZ from texture_return"), + anno::description("Returns float2(w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11134) +]] +{ return wz(texture_return_float4(a)); } + +export float2 ww( texture_return a) +[[ + anno::display_name("WW from texture_return"), + anno::description("Returns float2(w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float2"), + icon(".icons/component_extract.svg"), + anno::ui_order(11136) +]] +{ return ww(texture_return_float4(a)); } +//*********************************************************************************************************************** + + + +//*********************************************************************************************************************** +// Swizzles with float3 return type + +export float3 xyz( float3 a) +[[ + anno::display_name("XYZ from float3"), + anno::description("Returns float3(x,y,z) from float3."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11290) +]] +{ return float3( a.x, a.y, a.z); } + +export float3 xyz( float4 a) +[[ + anno::display_name("XYZ from float4"), + anno::description("Returns float3(x,y,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11291) +]] +{ return float3( a.x, a.y, a.z); } + + +// The remaining are hidden +export float3 yyw( float4 a) +[[ + anno::display_name("YYW from float4"), + anno::description("Returns float3(y,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11640) +]] +{ return float3( a.y, a.y, a.w); } + +export float3 xxx( float2 a) +[[ + anno::display_name("XXX from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11200) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float2 a) +[[ + anno::display_name("XXY from float2"), + anno::description("Returns float3(x,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11210) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xyx( float2 a) +[[ + anno::display_name("XYX from float2"), + anno::description("Returns float3(x,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11230) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float2 a) +[[ + anno::display_name("XYY from float2"), + anno::description("Returns float3(x,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11240) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 yxx( float2 a) +[[ + anno::display_name("YXX from float2"), + anno::description("Returns float3(y,x,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11250) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float2 a) +[[ + anno::display_name("YXY from float2"), + anno::description("Returns float3(y,x,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11260) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yyx( float2 a) +[[ + anno::display_name("YYX from float2"), + anno::description("Returns float3(y,y,x) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11270) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float2 a) +[[ + anno::display_name("YYY from float2"), + anno::description("Returns float3(y,y,y) from float2."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11280) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 xxx( float3 a) +[[ + anno::display_name("XXX from float3"), + anno::description("Returns float3(x,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11201) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float3 a) +[[ + anno::display_name("XXY from float3"), + anno::description("Returns float3(x,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11211) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float3 a) +[[ + anno::display_name("XXZ from float3"), + anno::description("Returns float3(x,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11220) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xyx( float3 a) +[[ + anno::display_name("XYX from float3"), + anno::description("Returns float3(x,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11231) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float3 a) +[[ + anno::display_name("XYY from float3"), + anno::description("Returns float3(x,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11241) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xzx( float3 a) +[[ + anno::display_name("XZX from float3"), + anno::description("Returns float3(x,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11300) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float3 a) +[[ + anno::display_name("XZY from float3"), + anno::description("Returns float3(x,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11310) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float3 a) +[[ + anno::display_name("XZZ from float3"), + anno::description("Returns float3(x,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11320) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 yxx( float3 a) +[[ + anno::display_name("YXX from float3"), + anno::description("Returns float3(y,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11251) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float3 a) +[[ + anno::display_name("YXY from float3"), + anno::description("Returns float3(y,x,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11261) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float3 a) +[[ + anno::display_name("YXZ from float3"), + anno::description("Returns float3(y,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11330) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yyx( float3 a) +[[ + anno::display_name("YYX from float3"), + anno::description("Returns float3(y,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11271) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float3 a) +[[ + anno::display_name("YYY from float3"), + anno::description("Returns float3(y,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11281) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float3 a) +[[ + anno::display_name("YYZ from float3"), + anno::description("Returns float3(y,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11340) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float3 a) +[[ + anno::display_name("YZX from float3"), + anno::description("Returns float3(y,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11350) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float3 a) +[[ + anno::display_name("YZY from float3.YZY"), + anno::description("Returns float3(y,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11360) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float3 a) +[[ + anno::display_name("YZZ from float3"), + anno::description("Returns float3(y,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11370) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 zxx( float3 a) +[[ + anno::display_name("ZXX from float3"), + anno::description("Returns float3(z,x,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11380) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float3 a) +[[ + anno::display_name("float3.ZXY"), + anno::description("Returns float3(z,x,y)."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11390) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float3 a) +[[ + anno::display_name("ZXZ from float3"), + anno::description("Returns float3(z,x,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11400) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zyx( float3 a) +[[ + anno::display_name("ZYX from float3"), + anno::description("Returns float3(z,y,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11410) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float3 a) +[[ + anno::display_name("ZYY from float3"), + anno::description("Returns float3(z,y,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11420) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float3 a) +[[ + anno::display_name("ZYZ from float3"), + anno::description("Returns float3(z,y,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11430) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zzx( float3 a) +[[ + anno::display_name("ZZX from float3"), + anno::description("Returns float3(z,z,x) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11440) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float3 a) +[[ + anno::display_name("ZZY from float3"), + anno::description("Returns float3(z,z,y) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11450) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float3 a) +[[ + anno::display_name("ZZZ from float3"), + anno::description("Returns float3(z,z,z) from float3."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11460) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 xxx( float4 a) +[[ + anno::display_name("XXX from float4"), + anno::description("Returns float3(x,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11202) +]] +{ return float3( a.x, a.x, a.x); } + +export float3 xxy( float4 a) +[[ + anno::display_name("XXY from float4"), + anno::description("Returns float3(x,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11212) +]] +{ return float3( a.x, a.x, a.y); } + +export float3 xxz( float4 a) +[[ + anno::display_name("XXZ from float4"), + anno::description("Returns float3(x,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11222) +]] +{ return float3( a.x, a.x, a.z); } + +export float3 xxw( float4 a) +[[ + anno::display_name("XXW from float4"), + anno::description("Returns float3(x,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11227) +]] +{ return float3( a.x, a.x, a.w); } + +export float3 xyx( float4 a) +[[ + anno::display_name("XYX from float4"), + anno::description("Returns float3(x,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11232) +]] +{ return float3( a.x, a.y, a.x); } + +export float3 xyy( float4 a) +[[ + anno::display_name("XYY from float4"), + anno::description("Returns float3(x,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11242) +]] +{ return float3( a.x, a.y, a.y); } + +export float3 xyw( float4 a) +[[ + anno::display_name("XYW from float4"), + anno::description("Returns float3(x,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11295) +]] +{ return float3( a.x, a.y, a.w); } + +export float3 xzx( float4 a) +[[ + anno::display_name("XZX from float4"), + anno::description("Returns float3(x,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11301) +]] +{ return float3( a.x, a.z, a.x); } + +export float3 xzy( float4 a) +[[ + anno::display_name("XZY from float4"), + anno::description("Returns float3(x,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11311) +]] +{ return float3( a.x, a.z, a.y); } + +export float3 xzz( float4 a) +[[ + anno::display_name("XZZ from float4"), + anno::description("Returns float3(x,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return float3( a.x, a.z, a.z); } + +export float3 xzw( float4 a) +[[ + anno::display_name("XZW from float4"), + anno::description("Returns float3(x,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11600) +]] +{ return float3( a.x, a.z, a.w); } + +export float3 xwx( float4 a) +[[ + anno::display_name("XWX from float4"), + anno::description("Returns float3(x,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11604) +]] +{ return float3( a.x, a.w, a.x); } + +export float3 xwy( float4 a) +[[ + anno::display_name("XWY from float4"), + anno::description("Returns float3(x,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11608) +]] +{ return float3( a.x, a.w, a.y); } + +export float3 xwz( float4 a) +[[ + anno::display_name("XWZ from float4"), + anno::description("Returns float3(x,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11612) +]] +{ return float3( a.x, a.w, a.z); } + +export float3 xww( float4 a) +[[ + anno::display_name("XWW from float4"), + anno::description("Returns float3(x,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11616) +]] +{ return float3( a.x, a.w, a.w); } + +export float3 yxx( float4 a) +[[ + anno::display_name("YXX from float4"), + anno::description("Returns float3(y,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11252) +]] +{ return float3( a.y, a.x, a.x); } + +export float3 yxy( float4 a) +[[ + anno::display_name("YXY from float4"), + anno::hidden(), + anno::description("Returns float3(y,x,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11262) +]] +{ return float3( a.y, a.x, a.y); } + +export float3 yxz( float4 a) +[[ + anno::display_name("YXZ from float4"), + anno::description("Returns float3(y,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11331) +]] +{ return float3( a.y, a.x, a.z); } + +export float3 yxw( float4 a) +[[ + anno::display_name("YXW from float4"), + anno::description("Returns float3(y,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11630) +]] +{ return float3( a.y, a.x, a.w); } + +export float3 yyx( float4 a) +[[ + anno::display_name("YYX from float4"), + anno::description("Returns float3(y,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11272) +]] +{ return float3( a.y, a.y, a.x); } + +export float3 yyy( float4 a) +[[ + anno::display_name("YYY from float4"), + anno::description("Returns float3(y,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11282) +]] +{ return float3( a.y, a.y, a.y); } + +export float3 yyz( float4 a) +[[ + anno::display_name("YYZ from float4"), + anno::description("Returns float3(y,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11341) +]] +{ return float3( a.y, a.y, a.z); } + +export float3 yzx( float4 a) +[[ + anno::display_name("YZX from float4"), + anno::description("Returns float3(y,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11351) +]] +{ return float3( a.y, a.z, a.x); } + +export float3 yzy( float4 a) +[[ + anno::display_name("YZY from float4"), + anno::description("Returns float3(y,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11361) +]] +{ return float3( a.y, a.z, a.y); } + +export float3 yzz( float4 a) +[[ + anno::display_name("YZZ from float4"), + anno::description("Returns float3(y,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11371) +]] +{ return float3( a.y, a.z, a.z); } + +export float3 yzw( float4 a) +[[ + anno::display_name("YZW from float4"), + anno::description("Returns float3(y,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11650) +]] +{ return float3( a.y, a.z, a.w); } + +export float3 ywx( float4 a) +[[ + anno::display_name("YWX from float4"), + anno::description("Returns float3(y,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11653) +]] +{ return float3( a.y, a.w, a.x); } + +export float3 ywy( float4 a) +[[ + anno::display_name("YWY from float4"), + anno::description("Returns float3(y,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11656) +]] +{ return float3( a.y, a.w, a.y); } + +export float3 ywz( float4 a) +[[ + anno::display_name("YWZ from float4"), + anno::description("Returns float3(y,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11658) +]] +{ return float3( a.y, a.w, a.z); } + +export float3 yww( float4 a) +[[ + anno::display_name("YWW from float4"), + anno::description("Returns float3(y,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11661) +]] +{ return float3( a.y, a.w, a.w); } + +export float3 zxx( float4 a) +[[ + anno::display_name("ZXX from float4"), + anno::description("Returns float3(z,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11381) +]] +{ return float3( a.z, a.x, a.x); } + +export float3 zxy( float4 a) +[[ + anno::display_name("ZXY from float4"), + anno::description("Returns float3(z,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11391) +]] +{ return float3( a.z, a.x, a.y); } + +export float3 zxz( float4 a) +[[ + anno::display_name("ZXZ from float4"), + anno::description("Returns float3(z,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11401) +]] +{ return float3( a.z, a.x, a.z); } + +export float3 zxw( float4 a) +[[ + anno::display_name("ZXW from float4"), + anno::description("Returns float3(z,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11671) +]] +{ return float3( a.z, a.x, a.w); } + +export float3 zyx( float4 a) +[[ + anno::display_name("ZYX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11411) +]] +{ return float3( a.z, a.y, a.x); } + +export float3 zyy( float4 a) +[[ + anno::display_name("ZYY from float4"), + anno::description("Returns float3(z,y,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11421) +]] +{ return float3( a.z, a.y, a.y); } + +export float3 zyz( float4 a) +[[ + anno::display_name("ZYZ from float4"), + anno::description("Returns float3(z,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11431) +]] +{ return float3( a.z, a.y, a.z); } + +export float3 zyw( float4 a) +[[ + anno::display_name("ZYW from float4"), + anno::description("Returns float3(z,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return float3( a.z, a.y, a.w); } + +export float3 zzx( float4 a) +[[ + anno::display_name("ZZX from float4"), + anno::description("Returns float3(z,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11441) +]] +{ return float3( a.z, a.z, a.x); } + +export float3 zzy( float4 a) +[[ + anno::display_name("ZZY from float4"), + anno::description("Returns float3(z,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11451) +]] +{ return float3( a.z, a.z, a.y); } + +export float3 zzz( float4 a) +[[ + anno::display_name("ZZZ from float4"), + anno::hidden(), + anno::description("Returns float3(z,z,z) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11461) +]] +{ return float3( a.z, a.z, a.z); } + +export float3 zzw( float4 a) +[[ + anno::display_name("ZZW from float4"), + anno::description("Returns float3(z,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11465) +]] +{ return float3( a.z, a.z, a.w); } + +export float3 zwx( float4 a) +[[ + anno::display_name("ZWX from float4"), + anno::description("Returns float3(z,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return float3( a.z, a.w, a.x); } + +export float3 zwy( float4 a) +[[ + anno::display_name("ZWY from float4"), + anno::description("Returns float3(z,w,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11471) +]] +{ return float3( a.z, a.w, a.y); } + +export float3 zwz( float4 a) +[[ + anno::display_name("ZWZ from float4"), + anno::description("Returns float3(z,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11475) +]] +{ return float3( a.z, a.w, a.z); } + +export float3 zww( float4 a) +[[ + anno::display_name("ZWW from float4"), + anno::description("Returns float3(z,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11479) +]] +{ return float3( a.z, a.w, a.w); } + +export float3 wxx( float4 a) +[[ + anno::display_name("WXX from float4"), + anno::description("Returns float3(w,x,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11483) +]] +{ return float3( a.w, a.x, a.x); } + +export float3 wxy( float4 a) +[[ + anno::display_name("WXY from float4"), + anno::description("Returns float3(w,x,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11487) +]] +{ return float3( a.w, a.x, a.y); } + +export float3 wxz( float4 a) +[[ + anno::display_name("WXZ from float4"), + anno::description("Returns float3(w,x,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11490) +]] +{ return float3( a.w, a.x, a.z); } + +export float3 wxw( float4 a) +[[ + anno::display_name("WXW from float4"), + anno::description("Returns float3(w,x,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11496) +]] +{ return float3( a.w, a.x, a.w); } + +export float3 wyx( float4 a) +[[ + anno::display_name("WYX from float4"), + anno::description("Returns float3(w,y,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11503) +]] +{ return float3( a.w, a.y, a.x); } + +export float3 wyy( float4 a) +[[ + anno::display_name("WYY from float4"), + anno::description("Returns float3(w,y,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11507) +]] +{ return float3( a.w, a.y, a.y); } + +export float3 wyz( float4 a) +[[ + anno::display_name("WYZ from float4"), + anno::description("Returns float3(w,y,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11510) +]] +{ return float3( a.w, a.y, a.z); } + +export float3 wyw( float4 a) +[[ + anno::display_name("WYW from float4"), + anno::description("Returns float3(w,y,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11514) +]] +{ return float3( a.w, a.y, a.w); } + +export float3 wzx( float4 a) +[[ + anno::display_name("WZX from float4"), + anno::description("Returns float3(w,z,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11518) +]] +{ return float3( a.w, a.z, a.x); } + +export float3 wzy( float4 a) +[[ + anno::display_name("WZY from float4"), + anno::description("Returns float3(w,z,y) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11521) +]] +{ return float3( a.w, a.z, a.y); } + +export float3 wzz( float4 a) +[[ + anno::display_name("WZZ from float4"), + anno::description("Returns float3(w,z,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11524) +]] +{ return float3( a.w, a.z, a.z); } + +export float3 wzw( float4 a) +[[ + anno::display_name("WZW from float4"), + anno::description("Returns float3(w,z,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11529) +]] +{ return float3( a.w, a.z, a.w); } + +export float3 wwx( float4 a) +[[ + anno::display_name("WWX from float4"), + anno::description("Returns float3(w,w,x) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return float3( a.w, a.w, a.x); } + +export float3 wwy( float4 a) +[[ + anno::display_name("WWY from float4"), + anno::hidden(), + anno::description("Returns float3(w,w,y) from float4."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11537) +]] +{ return float3( a.w, a.w, a.y); } + +export float3 wwz( float4 a) +[[ + anno::display_name("WWZ from float4"), + anno::description("Returns float3(w,w,z) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return float3( a.w, a.w, a.z); } + +export float3 www( float4 a) +[[ + anno::display_name("WWW from float4"), + anno::description("Returns float3(w,w,w) from float4."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11544) +]] +{ return float3( a.w, a.w, a.w); } + +export float3 xxx( color a) +[[ + anno::display_name("XXX from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11203) +]] +{ return xxx( float3(a)); } + +export float3 xxy( color a) +[[ + anno::display_name("XXY from color"), + anno::description("Returns float3(x,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11213) +]] +{ return xxy( float3(a)); } + +export float3 xxz( color a) +[[ + anno::display_name("XXZ from color"), + anno::description("Returns float3(x,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11223) +]] +{ return xxz( float3(a)); } + +export float3 xyx( color a) +[[ + anno::display_name("XYX from color"), + anno::description("Returns float3(x,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11233) +]] +{ return xyx( float3(a)); } + +export float3 xyy( color a) +[[ + anno::display_name("XYY from color"), + anno::description("Returns float3(x,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11243) +]] +{ return xyy( float3(a)); } + +export float3 xyz( color a) +[[ + anno::display_name("XYZ from color"), + anno::description("Returns float3(x,y,z) from color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11292) +]] +{ return xyz( float3(a)); } + +export float3 xzx( color a) +[[ + anno::display_name("XZX from color"), + anno::description("Returns float3(x,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11302) +]] +{ return xzx( float3(a)); } + +export float3 xzy( color a) +[[ + anno::display_name("XZY from color"), + anno::description("Returns float3(x,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11312) +]] +{ return xzy( float3(a)); } + +export float3 xzz( color a) +[[ + anno::display_name("XZZ from color"), + anno::description("Returns float3(x,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11323) +]] +{ return xzz( float3(a)); } + +export float3 yxx( color a) +[[ + anno::display_name("YXX from color"), + anno::description("Returns float3(y,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11253) +]] +{ return yxx( float3(a)); } + +export float3 yxy( color a) +[[ + anno::display_name("YXY from color"), + anno::description("Returns float3(y,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11263) +]] +{ return yxy( float3(a)); } + +export float3 yxz( color a) +[[ + anno::display_name("YXZ from color"), + anno::description("Returns float3(y,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11332) +]] +{ return yxz( float3(a)); } + +export float3 yyx( color a) +[[ + anno::display_name("YYX from color"), + anno::description("Returns float3(y,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11273) +]] +{ return yyx( float3(a)); } + +export float3 yyy( color a) +[[ + anno::display_name("YYY from color"), + anno::description("Returns float3(y,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11283) +]] +{ return yyy( float3(a)); } + +export float3 yyz( color a) +[[ + anno::display_name("YYZ from color"), + anno::description("Returns float3(y,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11342) +]] +{ return yyz( float3(a)); } + +export float3 yzx( color a) +[[ + anno::display_name("YZX from color"), + anno::description("Returns float3(y,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11352) +]] +{ return yzx( float3(a)); } + +export float3 yzy( color a) +[[ + anno::display_name("YZY from color"), + anno::description("Returns float3(y,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11362) +]] +{ return yzy( float3(a)); } + +export float3 yzz( color a) +[[ + anno::display_name("YZZ from color"), + anno::description("Returns float3(y,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11372) +]] +{ return yzz( float3(a)); } + +export float3 zxx( color a) +[[ + anno::display_name("ZXX from color"), + anno::description("Returns float3(z,x,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11382) +]] +{ return zxx( float3(a)); } + +export float3 zxy( color a) +[[ + anno::display_name("ZXY from color"), + anno::description("Returns float3(z,x,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11392) +]] +{ return zxy( float3(a)); } + +export float3 zxz( color a) +[[ + anno::display_name("ZXZ from color"), + anno::description("Returns float3(z,x,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11402) +]] +{ return zxz( float3(a)); } + +export float3 zyx( color a) +[[ + anno::display_name("ZYX from color"), + anno::description("Returns float3(z,y,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11412) +]] +{ return zyx( float3(a)); } + +export float3 zyy( color a) +[[ + anno::display_name("ZYY from color"), + anno::description("Returns float3(z,y,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11422) +]] +{ return zyy( float3(a)); } + +export float3 zyz( color a) +[[ + anno::display_name("ZYZ from color"), + anno::description("Returns float3(z,y,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11432) +]] +{ return zyz( float3(a)); } + +export float3 zzx( color a) +[[ + anno::display_name("ZZX from color"), + anno::description("Returns float3(z,z,x) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11442) +]] +{ return zzx( float3(a)); } + +export float3 zzy( color a) +[[ + anno::display_name("ZZY from color"), + anno::description("Returns float3(z,z,y) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11452) +]] +{ return zzy( float3(a)); } + +export float3 zzz( color a) +[[ + anno::display_name("ZZZ from color"), + anno::description("Returns float3(z,z,z) from color."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11462) +]] +{ return zzz( float3(a)); } + +export float3 xxx( texture_return a) +[[ + anno::display_name("XXX from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11204) +]] +{ return xxx(texture_return_float4(a)); } + +export float3 xxy( texture_return a) +[[ + anno::display_name("XXY from texture_return"), + anno::description("Returns float3(x,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11214) +]] +{ return xxy(texture_return_float4(a)); } + +export float3 xxz( texture_return a) +[[ + anno::display_name("XXZ from texture_return"), + anno::description("Returns float3(x,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11224) +]] +{ return xxz(texture_return_float4(a)); } + +export float3 xxw( texture_return a) +[[ + anno::display_name("XXW from texture_return"), + anno::description("Returns float3(x,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11229) +]] +{ return xxw(texture_return_float4(a)); } + +export float3 xyx( texture_return a) +[[ + anno::display_name("XYX from texture_return"), + anno::description("Returns float3(x,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11234) +]] +{ return xyx(texture_return_float4(a)); } + +export float3 xyy( texture_return a) +[[ + anno::display_name("XYY from texture_return"), + anno::description("Returns float3(x,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11244) +]] +{ return xyy(texture_return_float4(a)); } + +export float3 xyz( texture_return a) +[[ + anno::display_name("XYZ from texture_return"), + anno::description("Returns float3(x,y,z) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11293) +]] +{ return xyz(texture_return_float4(a)); } + +export float3 xyw( texture_return a) +[[ + anno::display_name("XYW from texture_return"), + anno::description("Returns float3(x,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11296) +]] +{ return xyw(texture_return_float4(a)); } + +export float3 xzx( texture_return a) +[[ + anno::display_name("XZX from texture_return"), + anno::description("Returns float3(x,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11303) +]] +{ return xzx(texture_return_float4(a)); } + +export float3 xzy( texture_return a) +[[ + anno::display_name("XZY from texture_return"), + anno::description("Returns float3(x,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1131) +]] +{ return xzy(texture_return_float4(a)); } + +export float3 xzz( texture_return a) +[[ + anno::display_name("XZZ from texture_return"), + anno::description("Returns float3(x,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11321) +]] +{ return xzz(texture_return_float4(a)); } + +export float3 xzw( texture_return a) +[[ + anno::display_name("XZW from texture_return"), + anno::description("Returns float3(x,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11601) +]] +{ return xzw(texture_return_float4(a)); } + +export float3 xwx( texture_return a) +[[ + anno::display_name("XWX from texture_return"), + anno::description("Returns float3(x,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11605) +]] +{ return xwx(texture_return_float4(a)); } + +export float3 xwy( texture_return a) +[[ + anno::display_name("XWY from texture_return"), + anno::description("Returns float3(x,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11609) +]] +{ return xwy(texture_return_float4(a)); } + +export float3 xwz( texture_return a) +[[ + anno::display_name("XWZ from texture_return"), + anno::description("Returns float3(x,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11613) +]] +{ return xwz(texture_return_float4(a)); } + +export float3 xww( texture_return a) +[[ + anno::display_name("XWW from texture_return"), + anno::description("Returns float3(x,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11617) +]] +{ return xww(texture_return_float4(a)); } + +export float3 yxx( texture_return a) +[[ + anno::display_name("YXX from texture_return"), + anno::description("Returns float3(y,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11254) +]] +{ return yxx(texture_return_float4(a)); } + +export float3 yxy( texture_return a) +[[ + anno::display_name("YXY from texture_return"), + anno::description("Returns float3(y,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11264) +]] +{ return yxy(texture_return_float4(a)); } + +export float3 yxz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11333) +]] +{ return yxz(texture_return_float4(a)); } + +export float3 yxw( texture_return a) +[[ + anno::display_name("YXW from texture_return"), + anno::description("Returns float3(y,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11631) +]] +{ return yxw(texture_return_float4(a)); } + +export float3 yyx( texture_return a) +[[ + anno::display_name("YYX from texture_return"), + anno::description("Returns float3(y,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11274) +]] +{ return yyx(texture_return_float4(a)); } + +export float3 yyy( texture_return a) +[[ + anno::display_name("YYY from texture_return"), + anno::description("Returns float3(y,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11284) +]] +{ return yyy(texture_return_float4(a)); } + +export float3 yyz( texture_return a) +[[ + anno::display_name("YYZ from texture_return"), + anno::description("Returns float3(y,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11344) +]] +{ return yyz(texture_return_float4(a)); } + +export float3 yyw( texture_return a) +[[ + anno::display_name("YYW from texture_return"), + anno::description("Returns float3(y,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11641) +]] +{ return yyw(texture_return_float4(a)); } + +export float3 yzx( texture_return a) +[[ + anno::display_name("YZX from texture_return"), + anno::description("Returns float3(y,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11354) +]] +{ return yzx(texture_return_float4(a)); } + +export float3 yzy( texture_return a) +[[ + anno::display_name("YZY from texture_return"), + anno::description("Returns float3(y,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11363) +]] +{ return yzy(texture_return_float4(a)); } + +export float3 yzz( texture_return a) +[[ + anno::display_name("YZZ from texture_return"), + anno::description("Returns float3(y,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11373) +]] +{ return yzz(texture_return_float4(a)); } + +export float3 yzw( texture_return a) +[[ + anno::display_name("YZW from texture_return"), + anno::description("Returns float3(y,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11651) +]] +{ return yzw(texture_return_float4(a)); } + +export float3 ywx( texture_return a) +[[ + anno::display_name("YWX from texture_return"), + anno::description("Returns float3(y,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11654) +]] +{ return ywx(texture_return_float4(a)); } + +export float3 ywy( texture_return a) +[[ + anno::display_name("YWY from texture_return"), + anno::description("Returns float3(y,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11657) +]] +{ return ywy(texture_return_float4(a)); } + +export float3 ywz( texture_return a) +[[ + anno::display_name("YXZ from texture_return"), + anno::description("Returns float3(y,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11659) +]] +{ return ywz(texture_return_float4(a)); } + +export float3 yww( texture_return a) +[[ + anno::display_name("YWW from texture_return"), + anno::description("Returns float3(y,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11662) +]] +{ return yww(texture_return_float4(a)); } + +export float3 zxx( texture_return a) +[[ + anno::display_name("ZXX from texture_return"), + anno::description("Returns float3(z,x,x) from texture_return."), + anno::author("NVIDIA Corporation"), + anno::hidden(), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11383) +]] +{ return zxx(texture_return_float4(a)); } + +export float3 zxy( texture_return a) +[[ + anno::display_name("ZXY from texture_return"), + anno::description("Returns float3(z,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11394) +]] +{ return zxy(texture_return_float4(a)); } + +export float3 zxz( texture_return a) +[[ + anno::display_name("ZXZ from texture_return"), + anno::description("Returns float3(z,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11403) +]] +{ return zxz(texture_return_float4(a)); } + +export float3 zxw( texture_return a) +[[ + anno::display_name("ZXW from texture_return"), + anno::description("Returns float3(z,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11672) +]] +{ return zxw(texture_return_float4(a)); } + +export float3 zyx( texture_return a) +[[ + anno::display_name("ZYX from texture_return"), + anno::description("Returns float3(z,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11413) +]] +{ return zyx(texture_return_float4(a)); } + +export float3 zyy( texture_return a) +[[ + anno::display_name("ZYY from texture_return"), + anno::description("Returns float3(z,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11423) +]] +{ return zyy(texture_return_float4(a)); } + +export float3 zyz( texture_return a) +[[ + anno::display_name("ZYZ from texture_return"), + anno::description("Returns float3(z,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyz(texture_return_float4(a)); } + +export float3 zyw( texture_return a) +[[ + anno::display_name("ZYW from texture_return"), + anno::description("Returns float3(z,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11433) +]] +{ return zyw(texture_return_float4(a)); } + +export float3 zzx( texture_return a) +[[ + anno::display_name("ZZX from texture_return"), + anno::description("Returns float3(z,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11443) +]] +{ return zzx(texture_return_float4(a)); } + +export float3 zzy( texture_return a) +[[ + anno::display_name("ZZY from texture_return"), + anno::description("Returns float3(z,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11453) +]] +{ return zzy(texture_return_float4(a)); } + +export float3 zzz( texture_return a) +[[ + anno::display_name("ZZZ from texture_return"), + anno::description("Returns float3(z,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11463) +]] +{ return zzz(texture_return_float4(a)); } + +export float3 zzw( texture_return a) +[[ + anno::display_name("ZZW from texture_return"), + anno::description("Returns float3(z,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11466) +]] +{ return zzw(texture_return_float4(a)); } + +export float3 zwx( texture_return a) +[[ + anno::display_name("ZWX from texture_return"), + anno::description("Returns float3(z,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11468) +]] +{ return zwx(texture_return_float4(a)); } + +export float3 zwy( texture_return a) +[[ + anno::display_name("ZWY from texture_return"), + anno::description("Returns float3(z,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11472) +]] +{ return zwy(texture_return_float4(a)); } + +export float3 zwz( texture_return a) +[[ + anno::display_name("ZWZ from texture_return"), + anno::description("Returns float3(z,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11476) +]] +{ return zwz(texture_return_float4(a)); } + +export float3 zww( texture_return a) +[[ + anno::display_name("texture_return.ZWW"), + anno::description("Returns float3(z,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11480) +]] +{ return zww(texture_return_float4(a)); } + +export float3 wxx( texture_return a) +[[ + anno::display_name("WXX from texture_return"), + anno::description("Returns float3(w,x,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11484) +]] +{ return wxx(texture_return_float4(a)); } + +export float3 wxy( texture_return a) +[[ + anno::display_name("WXY from texture_return"), + anno::description("Returns float3(w,x,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11488) +]] +{ return wxy(texture_return_float4(a)); } + +export float3 wxz( texture_return a) +[[ + anno::display_name("WXZ from texture_return"), + anno::description("Returns float3(w,x,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11493) +]] +{ return wxz(texture_return_float4(a)); } + +export float3 wxw( texture_return a) +[[ + anno::display_name("WXW from texture_return"), + anno::description("Returns float3(w,x,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11500) +]] +{ return wxw(texture_return_float4(a)); } + +export float3 wyx( texture_return a) +[[ + anno::display_name("WYX from texture_return"), + anno::description("Returns float3(w,y,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(1150) +]] +{ return wyx(texture_return_float4(a)); } + +export float3 wyy( texture_return a) +[[ + anno::display_name("WYY from texture_return"), + anno::description("Returns float3(w,y,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11508) +]] +{ return wyy(texture_return_float4(a)); } + +export float3 wyz( texture_return a) +[[ + anno::display_name("WYZ from texture_return"), + anno::description("Returns float3(w,y,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11511) +]] +{ return wyz(texture_return_float4(a)); } + +export float3 wyw( texture_return a) +[[ + anno::display_name("WYW from texture_return"), + anno::description("Returns float3(w,y,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11515) +]] +{ return wyw(texture_return_float4(a)); } + +export float3 wzx( texture_return a) +[[ + anno::display_name("WZX from texture_return"), + anno::description("Returns float3(w,z,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11519) +]] +{ return wzx(texture_return_float4(a)); } + +export float3 wzy( texture_return a) +[[ + anno::display_name("WZY from texture_return"), + anno::description("Returns float3(w,z,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11522) +]] +{ return wzy(texture_return_float4(a)); } + +export float3 wzz( texture_return a) +[[ + anno::display_name("WZZ from texture_return"), + anno::description("Returns float3(w,z,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11525) +]] +{ return wzz(texture_return_float4(a)); } + +export float3 wzw( texture_return a) +[[ + anno::display_name("WZW from texture_return"), + anno::description("Returns float3(w,z,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11530) +]] +{ return wzw(texture_return_float4(a)); } + +export float3 wwx( texture_return a) +[[ + anno::display_name("WWWX from texture_return"), + anno::description("Returns float3(w,w,x) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11533) +]] +{ return wwx(texture_return_float4(a)); } + +export float3 wwy( texture_return a) +[[ + anno::display_name("WWY from texture_return"), + anno::description("Returns float3(w,w,y) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11538) +]] +{ return wwy(texture_return_float4(a)); } + +export float3 wwz( texture_return a) +[[ + anno::display_name("WWZ from texture_return"), + anno::description("Returns float3(w,w,z) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11541) +]] +{ return wwz(texture_return_float4(a)); } + +export float3 www( texture_return a) +[[ + anno::display_name("WWW from texture_return"), + anno::description("Returns float3(w,w,w) from texture_return."), + anno::hidden(), + anno::author("NVIDIA Corporation"), + anno::in_group("Channel", "Float3"), + icon(".icons/component_extract.svg"), + anno::ui_order(11545) +]] +{ return www(texture_return_float4(a)); } diff --git a/unitree_z1/materials/mdl/core_definitions.mdl b/unitree_z1/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/unitree_z1/materials/mdl/core_definitions.mdl @@ -0,0 +1,5806 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +// The "//group ... //endgroup" comments are used during the +// procedural creation of this module's documentation. +mdl 1.8; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::limits::*; +import ::base::*; +import ::tex::*; +import ::anno::*; +export using ::base import texture_return; +export using ::base import mono_mode; +export using ::base import color_layer_mode; +import support_definitions::*; +module [[ + anno::version( 2, 2, 0), + anno::display_name("NVIDIA core definitions") +]]; + +export annotation icon(string path); + +const string COPYRIGHT = "Copyright 2023 NVIDIA Corporation. All rights reserved."; + +//some local functions, dont document + +// https://www.shadertoy.com/view/4djSRW +float2 hash22(float2 p) +{ + float3 p3 = math::frac(float3(p.x, p.y, p.x) * float3(0.1031, 0.1030, 0.0973)); + p3 += math::dot(p3, float3(p3.y, p3.z, p3.x) + 33.33); + return math::frac((float2(p3.x, p3.x) + float2(p3.y, p3.z)) * float2(p3.z, p3.y)); +} + +// Christophe Schlick. “Fast Alternatives to Perlin’s Bias and Gain Functions”. +// In Graphics Gems IV, Morgan Kaufmann, 1994, pages 401–403. +// https://dept-info.labri.fr/~schlick/DOC/gem2.html +float schlick_gain(float x, float r) +{ + float rr = math::clamp(r, 0.001, 0.999); // to avoid glitch + float a = (1.0 / rr - 2.0) * (1.0 - 2.0 * x); + return (x < 0.5) ? x / (a + 1.0) : (a - x) / (a - 1.0); +} + +// blend two normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +export float3 blend_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\""), + anno::soft_range(0.0,1.0) + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\""), + anno::soft_range(0.0,1.0) + ]] +) +[[ + anno::description("Blend two normals or apply a detail normal map"), + anno::display_name("Blend normals"), + anno::thumbnail(".thumbs/blend_normals.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT)]] +{ + return base::blend_normals(base_normal,base_normal_weight,detail_normal,detail_normal_weight); +} +// blend 3 normals, similar to +// http://blog.selfshadow.com/publications/blending-in-detail/ +//TODO: make public? +float3 blend_3_normals( + float3 base_normal = state::normal() + [[ + anno::description("The base normal") + ]], + float base_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the base normal using a linear blend between state::normal and \"base_normal\"") + ]], + float3 detail_normal = state::normal() + [[ + anno::description("The detail normal") + ]], + float detail_normal_weight = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]], + float3 detail_normal2 = state::normal() + [[ + anno::description("The detail normal2") + ]], + float detail_normal_weight2 = 1.0f + [[ + anno::description("Specifies the strength of the detail normal using a linear blend between state::normal and \"detail_normal\"") + ]] +) +[[ + anno::description("Blend three normals for sticker-like situations where a detail normal map is applied to a base normal map"), + anno::noinline() +]] +{ + float3 tu = state::texture_tangent_u(0); + float3 tv = state::texture_tangent_v(0); + float3 n = state::normal(); + + float w1 = math::saturate(base_normal_weight); + float w2 = math::saturate(detail_normal_weight); + float w3 = math::saturate(detail_normal_weight2); + + float3 n1_t = math::normalize( + float3(math::dot(tu, base_normal) * w1, + math::dot(tv, base_normal) * w1, + math::dot(n, base_normal) * w1 + 1.0f - w1)); + float3 n2_t = math::normalize( + float3(math::dot(tu, detail_normal) * w2, + math::dot(tv, detail_normal) * w2, + math::dot(n, detail_normal) * w2 + 1.0f - w2)); + float3 n3_t = math::normalize( + float3(math::dot(tu, detail_normal2) * w3, + math::dot(tv, detail_normal2) * w3, + math::dot(n, detail_normal2) * w3 + 1.0f - w3)); + + n1_t.z += 1.0f; + n2_t.x = -n2_t.x; + n2_t.y = -n2_t.y; + + float3 n12_t = n1_t * math::dot(n1_t, n2_t) / n1_t.z - n2_t; + + n12_t.z+= 1.0f; + n3_t.x = -n3_t.x; + n3_t.y = -n3_t.y; + float3 n_t = n12_t * math::dot(n12_t, n3_t) / n12_t.z - n3_t; + + return math::normalize( + tu * n_t.x + + tv * n_t.y + + n * n_t.z); +} + +// blend 3 normals by blending the gradients +// Morten S. Mikkelsen, Surface Gradient–Based Bump Mapping Framework, Journal of +// Computer Graphics Techniques (JCGT), vol. 9, no. 3, 60–90, 2020 +// http://jcgt.org/published/0009/03/04/ +float3 gradient_blend_3_normals( + float3 normal1 = state::normal(), + float normal1_weight = 1.0, + float3 normal2 = state::normal(), + float normal2_weight = 1.0, + float3 normal3 = state::normal(), + float normal3_weight = 1.0 +) +{ + float w1 = math::saturate(normal1_weight); + float w2 = math::saturate(normal2_weight); + float w3 = math::saturate(normal3_weight); + + // normal to gradient + float3 n = state::normal(); + float d1 = math::dot(n, normal1); + float d2 = math::dot(n, normal2); + float d3 = math::dot(n, normal3); + float3 g1 = (d1 * n - normal1) / math::max(limits::FLOAT_MIN, math::abs(d1)); + float3 g2 = (d2 * n - normal2) / math::max(limits::FLOAT_MIN, math::abs(d2)); + float3 g3 = (d3 * n - normal3) / math::max(limits::FLOAT_MIN, math::abs(d3)); + + // blend + float3 gg = w1 * g1 + w2 * g2 + w3 * g3; + + // gradient to normal + return math::normalize(n - gg); +} + +struct complex_ior +{ + color n; //refractive index + color k; //extinction coefficient +}; + + +//[Gulbrandsen2014] Ole Gulbrandsen, 2014. Artist friendly metallic fresnel. +complex_ior artistic_metal_to_complex_ior( + color reflectivity, + color edge_tint) +{ + float epsilon = 1.e-2; + color r = math::lerp(color(epsilon), color(1.0 - epsilon), reflectivity); + color g = edge_tint; + + color r_sqrt = math::sqrt(r); + color n_min = (1.0f - r) / (1.0f + r); + color n_max = (1.0f + r_sqrt) / (1.0f - r_sqrt); + + color n = math::lerp(n_max, n_min, g); + + color k2 = ((n + 1.0f) * (n + 1.0f) * r - (n - 1.0f) * (n - 1.0f)) / (1.0f - r); + k2 = math::max(k2, 0.0f); + color k = math::sqrt(k2); + + return complex_ior(n, k); +} + + + +float3x3 axis_rotation_matrix(float3 a, float r) +{ + float[2] sc = math::sincos(r); + float s = sc[0]; + float c = sc[1]; + float omc = 1.0 - c; + return float3x3( + a.x * a.x * omc + c, a.x * a.y * omc - a.x * s, a.x * a.z * omc + a.y * s, + a.y * a.x * omc + a.z * s, a.y * a.y * omc + c, a.y * a.z * omc - a.x * s, + a.z * a.x * omc - a.y * s, a.z * a.y * omc + a.x * s, a.z * a.z * omc + c + ); +} +float3 transform_rotate(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return p*rotate; + +} +float3 transform_rotate_inv(float3 p, float3 r) +{ + // Euler rotation matrix xyz order to stay compatible with ::base + float3 s = math::sin(r); + float3 c = math::cos(r); + float3x3 rotate = + float3x3( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , + -s.y , s.x*c.y , c.x*c.y ); + return rotate*p; + +} + +//group Enumerations + +export enum material_type +[[ + anno::display_name("User interface group"), + anno::description("User interface grouping hint for materials"), + anno::hidden() +]] +{ + simple_material + [[ anno::description("Simple material") ]], + complex_material + [[ anno::description("Complex material") ]], + combiner_material + [[ anno::description("Combiner material") ]], + modifier_material + [[ anno::description("Material modifier") ]] +}; + +export enum emission_type +[[ + anno::display_name("Emission mode"), + anno::description("Emission mode definition for light sources"), + anno::hidden() +]] +{ + lumen_m2 + [[ anno::description("lumen/m2") ]], + lumen + [[ anno::description("lumen") ]], + candela + [[ anno::description("candela") ]], + nit + [[ anno::description("nit (candela/m2)") ]] +}; + +export enum cell_type +[[ + anno::display_name("Worley noise cell type"), + anno::description("Behavior of the Worley noise cell"), + anno::hidden() +]] +{ + simple_cells = 0 + [[ anno::description("Simple cells") ]], + crystal_cells = 1 + [[ anno::description("Crystal cells") ]], + bordered_cells = 2 + [[ anno::description("Bordered cells") ]] +}; + +export enum cell_base +[[ + anno::display_name("Worley noise cell shape"), + anno::description("Shape of the Worley noise cell"), + anno::hidden() +]] +{ + circular_cells = 0 + [[ anno::description("Circle base") ]], + diamond_cells = 1 + [[ anno::description("Diamond base") ]] +}; + +export enum displacement_vector_space +[[ + anno::display_name("Displacement mode"), + anno::description("Displacement Mode"), + anno::hidden() +]] +{ + // displacement_height = 0 // reserve this for now + // [[ anno::display_name("Height") ]], + + displacement_vector_tangent_space = 1 + [[ anno::display_name("Vector, Tangent Space") ]], + + displacement_vector_object_space = 2 + [[ anno::display_name("Vector, Object Space") ]], + + displacement_vector_world_space = 3 + [[ anno::display_name("Vector, World Space") ]] +}; + +//endgroup + +float3 transform_displacement_vector( + float3 displacement = float3(0.0) + [[ anno::description("Displacement vector") ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ anno::description("Space of the displacement vector") ]], + float scale = 1.0f + [[ anno::description("Displacement scale") ]] +) +[[ + anno::description("Transform input displacement vector to dispacement offset"), + anno::hidden() +]] +{ + float3 result; + switch (space) + { + // case displacement_height: + // result = state::normal() * displacement * scale; + // break; + + case displacement_vector_tangent_space: + result = state::texture_tangent_u(0) * displacement[0] * scale + + state::texture_tangent_v(0) * displacement[2] * scale + + state::normal() * displacement[1] * scale; + break; + + case displacement_vector_object_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_object, + displacement * scale + ); + break; + + case displacement_vector_world_space: + result = state::transform_point( + state::coordinate_internal, + state::coordinate_world, + displacement * scale + ); + break; + + default: + result = state::position(); + break; + } + + return result; +} + +float4x4 rotation_translation_scale( + float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale"), + anno::hidden() +]] +{ + float4x4 scale = + float4x4(scaling.x , 0. , 0. , 0., + 0. , scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + translation.x , translation.y , translation.z , 1.); + + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0, + c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0, + -s.y , s.x*c.y , c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + + return scale*rotate; +} + +export annotation suitable_as_light(); +export annotation type_of_material(material_type type); +export annotation dimension(float dimension); +export annotation dimension(float2 dimension); +export annotation dimension(float3 dimension); + + +//group Texturing functions + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +blend_colors( + color color_1 = color(0.0) + [[ anno::display_name("Color 1") ]], + color color_2 = color(1.0) + [[ anno::display_name("Color 2") ]], + uniform color_layer_mode mode = color_layer_blend + [[ + anno::description("Describes how Color 1 and Color 2 are combined"), + anno::display_name("Blend mode") + ]], + float weight = 1. + [[ + anno::description("Defines strength of the effect. At weight 0, only color 1 will be visible. At weight 1, the blend function will have full effect."), + anno::display_name("Blend weight"), + anno::soft_range(0.0,1.0) + ]], + uniform bool linear_blend = true + [[ + anno::description("The blend opperation can either be applied in linear or gamma (2.2) color space"), + anno::display_name("Linear blend") + ]] +) +[[ + anno::display_name("Blend colors"), + anno::description("Allows combining textures and colors in varied ways"), + anno::thumbnail(".thumbs/blend_colors.png"), + anno::in_group("Texturing", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(33), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + color c1 = linear_blend? color_1: math::pow(color_1,0.45); + color c2 = linear_blend? color_2: math::pow(color_2,0.45); + float w = linear_blend? weight: math::pow(weight,0.45); + texture_return r = base::blend_color_layers( + layers: base::color_layer[]( + base::color_layer( + layer_color: c2, + weight: w, + mode: mode + )), + base: c1 + ); + return linear_blend? r: texture_return(math::pow(r.tint,2.2),math::pow(r.mono,2.2)); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(0) + ]], + uniform mono_mode mono_source = mono_average + [[ + anno::display_name("Scalar mode"), + anno::description("Defines how the texture applies to scalar parameters"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(1) + ]], + uniform float brightness = 1. + [[ + anno::display_name("Brightness"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0) + ]], + uniform float contrast = 1. + [[ + anno::display_name("Contrast"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture, color will be black and the scalar value will be 0."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(5) + ]], + uniform bool invert = false + [[ + anno::description("Invert image"), + anno::display_name("Invert image"), + anno::in_group("Bitmap parameters"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return invert == false? base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(0.5*brightness-0.5*contrast*brightness), + color_scale: color(brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ): base::file_texture( + texture: texture, + mono_source: mono_source, + color_offset: color(1.0-0.5*brightness+0.5*contrast*brightness), + color_scale: color(-brightness*contrast), + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clip:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clip:tex::wrap_repeat + ); +} +export color triplanar_file_texture( + uniform texture_2d texture_1 + [[ + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary texture used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4), + anno::description("Optional texture used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::description("Optional texture used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::hard_range(0.0,1.0) + ]], + uniform color mean = color(0.0) + [[ + anno::description("Allows tweaking of the blend function. A value of 0 disables the function."), + anno::display_name("Mean color"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15), + anno::hard_range(color(0.0),color(1.0)) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]] +) +[[ + anno::display_name("Triplanar Bitmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(30), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position = state::transform_point(state::coordinate_internal, space, state::position()); + //TODO: pretransform the space? At least rotating the original space seems desireable and more is not feasible without dedicated ui (gizmo) + normal = transform_rotate(normal, math::radians(rotate_origin)); + position = transform_rotate(position, math::radians(rotate_origin)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? pow has the drawback of needing 3 lookups nearly always + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + //weights = math::saturate(weights-float3(1.-blend_range)); + + weights /=float3(weights.x+weights.y+weights.z); + + + float2 st1 = normal.x>0?float2(-position.z,position.y):float2(-position.z,-position.y); + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + + color c1 = weights.x>0? + support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st1)) + :color(0.); + color c2 = weights.y>0? tex::texture_isvalid(texture_2)? + support_definitions::lookup_color( + texture_2, + support_definitions::transform_st(math::radians(rotation_2),translation_2,scaling_2,st2)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st2)) + :color(0.); + color c3 = weights.z>0? tex::texture_isvalid(texture_3)? + support_definitions::lookup_color( + texture_3, + support_definitions::transform_st(math::radians(rotation_3),translation_3,scaling_3,st3)) + :support_definitions::lookup_color( + texture_1, + support_definitions::transform_st(math::radians(rotation_1),translation_1,scaling_1,st3)) + :color(0.); + return mean == color(0.0)? + c1*weights.x + c2*weights.y+ c3*weights.z: + support_definitions::biased_color_blend(weights.x,c1,weights.y,c2,weights.z,c3,mean); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +perlin_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Perlin noise texture"), + anno::description("Enable texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(34), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_texture( + color1: color1, + color2: color2, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 perlin_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,5.0), + anno::description("Overall bump intensity applied to the generated Perlin noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(3) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Perlin noise texture -- bump mapping"), + anno::description("Enable bump-map texturing with a random noise pattern"), + anno::thumbnail(".thumbs/perlin_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Perlin"), + icon(".icons/perlin_noise_texture.svg"), + anno::ui_order(35), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::perlin_noise_bump_texture( + factor: factor, + noise_levels: noise_levels, + absolute_noise: absolute_noise, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +worley_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space") , + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + uniform cell_type mode = simple_cells + [[ + anno::display_name("Cell type") , + anno::description("Cell pattern type"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(10) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(9) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]]) +[[ + anno::display_name("Cellular noise texture"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(36), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_texture( + color1: color1, + color2: color2, + mode: mode==crystal_cells?2:mode==bordered_cells?3:0, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 worley_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated Worley noise normal perturbation.") + ]], + uniform cell_base metric = circular_cells + [[ + anno::display_name("Cell shape") , + anno::description("The shape of the cell form"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = true + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(5) + ]], + uniform float noise_threshold_high = 1. + [[ + anno::hard_range(0.0,1.), + anno::description("Lowering this value will create bigger areas uniformly colored with Color 1"), + anno::display_name("Upper threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(3) + ]], + uniform float noise_threshold_low = 0. + [[ + anno::hard_range(0.0,1.), + anno::description("Increasing this value will create bigger areas uniformly colored with Color 2"), + anno::display_name("Lower threshold"), + anno::in_group("Noise parameters"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(8) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(7) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(6) + ]]) +[[ + anno::display_name("Cellular noise texture -- bump mapping"), + anno::description("Allow texturing with a cell forming pattern"), + anno::thumbnail(".thumbs/worley_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Worley"), + icon(".icons/cellular_noise_texture.svg"), + anno::ui_order(37), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::worley_noise_bump_texture( + factor: factor, + metric: metric, + noise_threshold_high: noise_threshold_high, + noise_threshold_low: noise_threshold_low, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +flow_noise_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + uniform int noise_levels = 3 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3) + + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4) + + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the third dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9), + anno::soft_range(0.0,1.0) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(15) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(14) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(13) + ]]) +[[ + anno::display_name("Flow noise texture"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(38), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_texture( + color1: color1, + color2: color2, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 flow_noise_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the generated flow-noise normal perturbation.") + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(12) + ]], + uniform int noise_levels = 1 + [[ + anno::description("Higher amounts will add detail to the noise"), + anno::display_name("Levels"), + anno::hard_range(1,6), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(1) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(8) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(9) + ]], + uniform bool absolute_noise = false + [[ + anno::display_name("Billowing appearance"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(2), + anno::description("Enables billowing noise by folding negative noise values into the positive range.") + ]], + uniform float phase = 0.0 + [[ + anno::display_name("Phase offset"), + anno::description("Controls the 3rd dimension of the function"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,1.0) + ]], + uniform float level_gain = 0.5 + [[ + anno::display_name("Level intensity gain"), + anno::description("If multiple levels are used, this parameter specifies a weighting factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(4), + anno::soft_range(0.0,1.0) + ]], + uniform float level_scale = 2.0 + [[ + anno::display_name("Level scaling"), + anno::description("If multiple levels are used, this parameter specifies a global scaling factor for subsequent levels"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(5), + anno::soft_range(0.0,4.0) + ]], + uniform float level_progressive_u_scale = 1. + [[ + anno::display_name("Progressive u scale"), + anno::description("If multiple levels are used, this parameter specifies an additional scaling factor in the \"u\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,1.0) + ]], + uniform float level_progressive_v_motion = 0. + [[ + anno::display_name("Progressive v offset"), + anno::description("If multiple levels are used, this parameter specifies an offset for subsequent levels in the \"v\" direction"), + anno::in_group("Noise parameters"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(7), + anno::soft_range(0.0,1.0) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(11) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(10) + ]] +) +[[ + anno::display_name("Flow noise texture -- bump mapping"), + anno::description("Allow texturing with a 2D noise pattern suitable for waves"), + anno::thumbnail(".thumbs/flow_noise_bump_texture.png"), + anno::in_group("Texturing", "Noise", "Flow"), + icon(".icons/flow_noise_texture.svg"), + anno::ui_order(39), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::flow_noise_bump_texture( + factor: factor, + levels: noise_levels, + phase: phase, + level_gain: level_gain, + level_scale: level_scale, + level_progressive_u_scale: level_progressive_u_scale, + level_progressive_v_motion: level_progressive_v_motion, + absolute_noise: absolute_noise, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export texture_return +[[ anno::node_output_port_default(anno::node_port_value_and_fields)]] +checker_texture( + color color1 = color(1.) + [[ + anno::display_name("Color 1"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0) + ]], + color color2 = color(0.) + [[ + anno::display_name("Color 2"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(7) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("3D checker texture"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(40), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_texture( + color1: color1, + color2: color2, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 checker_bump_texture( + uniform float factor = 1. + [[ + anno::display_name("Bump strength"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(0), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the checker pattern.") + ]], + uniform float blur = 0 + [[ + anno::hard_range(0.0,1.0), + anno::display_name("Blur"), + anno::in_group("Checker parameters"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(1), + anno::description("Amount of softening applied to checker cell boundaries.") + ]], + uniform bool object_space = false + [[ + anno::description("If off, UV space will be used. If on, 3D texturing in object space will apply. For applications that do not support object space, world space will be used."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(2) + ]], + float3 scaling = float3(10.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(6) + ]], + float3 translation = float3(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(5) + ]], + float3 rotation = float3(0.) + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(4) + ]], + uniform int texture_space = 0 + [[ + anno::description("Only applies if \"Use object space\" is off. Selects a specific UV space."), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(3) + ]] +) +[[ + anno::display_name("3D checker texture -- bump mapping"), + anno::description("Allows texturing a checkerboard pattern"), + anno::thumbnail(".thumbs/checker_bump_texture.png"), + anno::in_group("Texturing", "Checker"), + icon(".icons/checker_3d_texture.svg"), + anno::ui_order(41), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::checker_bump_texture( + factor: factor, + blur: blur/4., + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: object_space?scaling*state::meters_per_scene_unit() :scaling, + translation: translation, + rotation: math::radians(rotation) + ), + coordinate: object_space? + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + base::coordinate_source(texture_space: texture_space) + ) + ); +} + +export float3 file_bump_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Bitmap texture used as the bump source.") + ]], + uniform mono_mode bump_source = mono_average + [[ + anno::display_name("Bump mode"), + anno::description("Defines how the texture is evaluated to create the bumps"), + anno::in_group("Bitmap parameters"), + anno::ui_order(2) + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat"), + anno::display_name("Clip"), + anno::in_group("Placement"), + anno::ui_order(5) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Bump strength"), + anno::in_group("Bitmap parameters"), + anno::ui_order(3), + anno::soft_range(0.0,1.0), + anno::description("Overall bump intensity applied to the sampled bitmap bump values.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + anno::ui_order(4) + ]] +) +[[ + anno::display_name("Bitmap texture, bump"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_bump_texture.png"), + anno::in_group("Texturing"), + icon(".icons/bitmap_texture.svg"), + anno::ui_order(31), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::file_bump_texture( + texture: texture, + bump_source: bump_source, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + clip: clip + ); +} + +export float3 normalmap_texture( + uniform texture_2d texture + [[ + anno::display_name("Normalmap file"), + anno::in_group("Normalmap parameters"), + icon(".icons/normal_map_texture.svg"), + anno::usage("normal"), + anno::ui_order(1), + anno::description("Tangent-space normal map texture.") + ]], + float2 scaling = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(8) + ]], + float2 translation = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(7) + ]], + float rotation = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6), + anno::soft_range(0.0,360.0) + ]], + uniform bool clip = false + [[ + anno::description("If set to true, texture will not repeat. Outside of the texture the surface will be flat."), + anno::display_name("Clip"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(4) + + ]], + uniform float factor = 1 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(2), + anno::soft_range(0.0,1.0), + anno::description("Strength multiplier applied to the sampled normal-map perturbation.") + ]], + uniform int texture_space = 0 + [[ + anno::description("Selects a specific UV space"), + anno::display_name("UV space index"), + anno::hard_range(0,3), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(3) + ]], + uniform bool flip = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("Placement"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(6) + ]] +) +[[ + anno::display_name("Normal map texture"), + anno::description("Allows the use of tangent space normal maps"), + anno::thumbnail(".thumbs/normalmap_texture.png"), + anno::in_group("Texturing"), + icon(".icons/normal_map_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + return base::tangent_space_normal_texture( + texture: texture, + factor: factor, + uvw: base::transform_coordinate( + transform: rotation_translation_scale( + scaling: float3(scaling.x, scaling.y, 1.0), + rotation: float3(0.0, 0.0, math::radians(rotation) ), + translation: float3(translation.x, translation.y, 0.0) + ), + coordinate: base::coordinate_source(texture_space: texture_space) + ), + wrap_u: clip?tex::wrap_clamp:tex::wrap_repeat, + wrap_v: clip?tex::wrap_clamp:tex::wrap_repeat, + flip_tangent_v: flip, + clip: clip + ); +} +export float3 triplanar_normalmap_texture( + uniform texture_2d texture_1 + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(0), + anno::description("Primary normal map used for triplanar projection (X axis, and fallback for missing optional textures).") + ]], + float2 scaling_1 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(1) + ]], + float2 translation_1 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(2) + ]], + float rotation_1 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(3), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_1 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("1st Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(4) + ]], + uniform texture_2d texture_2 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::usage("normal"), + anno::ui_order(4), + anno::description("Optional normal map used for the second triplanar projection axis (Y axis).") + ]], + float2 scaling_2 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(5) + ]], + float2 translation_2 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::ui_order(6) + ]], + float rotation_2 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(7), + anno::enable_if( "tex::texture_isvalid(texture_2)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_2 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("2nd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8) + ]], + uniform texture_2d texture_3 = texture_2d() + [[ + anno::display_name("Bitmap file"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(8), + anno::usage("normal"), + anno::description("Optional normal map used for the third triplanar projection axis (Z axis).") + ]], + float2 scaling_3 = float2(1.) + [[ + anno::description("Controls the scale of the texture on the object"), + anno::display_name("Tiling"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(9) + ]], + float2 translation_3 = float2(0.) + [[ + anno::description("Controls position of the texture on the object"), + anno::display_name("Offset"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::ui_order(10) + ]], + float rotation_3 = 0. + [[ + anno::description("Rotation angle of the texture in degrees"), + anno::display_name("Rotation"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(11), + anno::enable_if( "tex::texture_isvalid(texture_3)" ), + anno::soft_range(0.0,360.0) + ]], + uniform bool flip_3 = false + [[ + anno::description("Flip handedness of the tangent space"), + anno::display_name("Flip V"), + anno::in_group("3rd Bitmap parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(12) + ]], + float blend_range = 0.5 + [[ + anno::description("Defines the size of the transition area. 0 means hard transition, 1 means blending happens very softly."), + anno::display_name("Blend range"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(13), + anno::hard_range(0.0,1.0) + ]], + float strength = 1.0 + [[ + anno::description("Overall strength of the normalmap"), + anno::display_name("Strength"), + anno::in_group("Common parameters"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(14), + anno::soft_range(0.0,10.0) + ]], + uniform float3 rotate_origin = float3(0.0) + [[ + anno::description("Allows manual alignment of the projection with an object"), + anno::display_name("Rotation of origin"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(16), + anno::soft_range(float3(0.0),float3(360.0)) + ]], + uniform bool object_space = true + [[ + anno::description("If off, world space will be used for generating texture coordinates. If on, object space will apply."), + anno::display_name("Use object space"), + anno::in_group("Placement"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Triplanar Normalmap texture"), + anno::description("Allows texturing using image files of various file formats"), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Triplanar"), + icon(".icons/triplanar_texture.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + state::coordinate_space space = object_space?state::coordinate_object:state::coordinate_world; + + float3 normal = state::transform_normal(state::coordinate_internal, space, state::normal()); + float3 position_original = state::transform_point(state::coordinate_internal, space, state::position()); + float3 rotation_origin_rad = math::radians(rotate_origin); + normal = transform_rotate(normal, rotation_origin_rad); + float3 position = transform_rotate(position_original, rotation_origin_rad); + float3 ty = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,-1.,0.)),rotation_origin_rad)); + float3 tz = + math::normalize( + transform_rotate_inv(state::transform_vector(space,state::coordinate_internal,float3(0.,0.,-1.)),rotation_origin_rad)); + + float3 weights = math::abs(normal); + + //TODO: blendrange through pow or is there something better? Pow means relatively little area where only 1 texture is looked up + weights /=math::max_value(weights); + weights = math::pow(weights,1./math::max(blend_range, 0.001)); + + + + float2 st1 = normal.x>0.0?float2(-position.z,position.y):float2(-position.z,-position.y); + float3 ts = math::normalize(math::cross(state::normal(),tz)); + float3 tt1 = math::normalize(math::cross(state::normal(),ts)); + + float2 st2 = normal.y>0?float2(-position.z,-position.x):float2(-position.z,position.x); + + float2 st3 = normal.z>0?float2(-position.y,position.x):float2(-position.y,-position.x); + float3 ts3 = math::normalize(math::cross(state::normal(),ty)); + float3 tt3 = math::normalize(math::cross(state::normal(),ts3)); + + tt3 = ( (tex::texture_isvalid(texture_3) && flip_3) || flip_1)? -tt3: tt3; + float3 tt2 = ( (tex::texture_isvalid(texture_2) && flip_2) || flip_1)? -tt1: tt1; + tt1 = flip_1? -tt1: tt1; + + float rotation_1_rad = math::radians(rotation_1); + float3x3 tan_rotation_mat_1 = axis_rotation_matrix(state::normal(), -rotation_1_rad); + float3 n1 = weights.x>0 && tex::texture_isvalid(texture_1)? + (support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st1))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength); + n1 = math::normalize( + ts * tan_rotation_mat_1 * n1.x + + tt1 * tan_rotation_mat_1 * n1.y + + state::normal() * (n1.z + (1.0 - strength))); + + float rotation_2_rad = math::radians(rotation_2); + float3x3 tan_rotation_mat_2 = tex::texture_isvalid(texture_2) + ? axis_rotation_matrix(state::normal(), -rotation_2_rad) + : tan_rotation_mat_1; + float3 n2 = weights.y>0? tex::texture_isvalid(texture_2)? + (support_definitions::lookup_float3( + texture_2, + support_definitions::transform_st(rotation_2_rad,translation_2,scaling_2,st2))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st2))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n2 = math::normalize( + ts * tan_rotation_mat_2 * n2.x + + tt2 * tan_rotation_mat_2 * n2.y + + state::normal() * (n2.z + (1.0 - strength))); + + float rotation_3_rad = math::radians(rotation_3); + float3x3 tan_rotation_mat_3 = tex::texture_isvalid(texture_3) + ? axis_rotation_matrix(state::normal(), -rotation_3_rad) + : tan_rotation_mat_1; + float3 n3 = weights.z>0? tex::texture_isvalid(texture_3)? + (support_definitions::lookup_float3( + texture_3, + support_definitions::transform_st(rotation_3_rad,translation_3,scaling_3,st3))- float3(0.5)) * (2.0 * strength) + :tex::texture_isvalid(texture_1)?(support_definitions::lookup_float3( + texture_1, + support_definitions::transform_st(rotation_1_rad,translation_1,scaling_1,st3))- float3(0.5)) * (2.0 * strength) + :float3(0.,0.,strength):float3(0.,0.,strength); + n3 = math::normalize( + ts3 * tan_rotation_mat_3 * n3.x + + tt3 * tan_rotation_mat_3 * n3.y + + state::normal() * (n3.z + (1.0 - strength))); + + return blend_3_normals(n1,weights.x,n2,weights.y,n3,weights.z); +} + +// Morten S. Mikkelsen, Practical Real-Time Hex-Tiling, Journal of Computer Graphics +// Techniques (JCGT), vol. 11, no. 2, 77-94, 2022 +// http://jcgt.org/published/0011/03/05/ +struct hextile_data { + float2 coord1; + float2 coord2; + float2 coord3; + float3 weights; + float3x3 tangent_rot_mat1; + float3x3 tangent_rot_mat2; + float3x3 tangent_rot_mat3; +}; + +hextile_data hextile_coord( + float2 coord, + float rotation, + float2 rotation_range, + float scale, + float2 scale_range, + float offset, + float2 offset_range) +{ + float sqrt3_2 = math::sqrt(3.0) * 2.0; + + // scale coord to maintain the original fit + float2 st = coord * sqrt3_2; + + // skew input space into simplex triangle grid + // (1, 0, -tan(30), 2*tan(30)) + float2x2 to_skewed = float2x2(1.0, 0.0, -0.57735027, 1.15470054); + float2 st_skewed = to_skewed * st; + + // barycentric weights + float2 st_frac = math::frac(st_skewed); + float3 temp = float3(st_frac.x, st_frac.y, 0.0); + temp.z = 1.0 - temp.x - temp.y; + + float s = math::step(0.0, -temp.z); + float s2 = 2.0 * s - 1.0; + + float w1 = -temp.z * s2; + float w2 = s - temp.y * s2; + float w3 = s - temp.x * s2; + + // vertex IDs + int2 base_id = int2(math::floor(st_skewed)); + int si = int(s); + int2 id1 = base_id + int2(si, si); + int2 id2 = base_id + int2(si, 1 - si); + int2 id3 = base_id + int2(1 - si, si); + + // tile center + float2x2 inv_skewed = float2x2(1.0, 0.0, 0.5, 1.0 / 1.15470054); + float2 ctr1 = inv_skewed * float2(id1) / float2(sqrt3_2); + float2 ctr2 = inv_skewed * float2(id2) / float2(sqrt3_2); + float2 ctr3 = inv_skewed * float2(id3) / float2(sqrt3_2); + + // reuse hash for performance + float2 seed_offset = float2(0.12345); // to avoid some zeros + float2 rand1 = hash22(float2(id1) + seed_offset); + float2 rand2 = hash22(float2(id2) + seed_offset); + float2 rand3 = hash22(float2(id3) + seed_offset); + + // randomized rotation matrix + float2 rr = math::radians(rotation_range); + float rrr1 = math::lerp(rr.x, rr.y, rand1.x * rotation); + float rrr2 = math::lerp(rr.x, rr.y, rand2.x * rotation); + float rrr3 = math::lerp(rr.x, rr.y, rand3.x * rotation); + float[2] sc1 = math::sincos(rrr1); + float[2] sc2 = math::sincos(rrr2); + float[2] sc3 = math::sincos(rrr3); + float2x2 rm1 = float2x2(sc1[1], -sc1[0], sc1[0], sc1[1]); + float2x2 rm2 = float2x2(sc2[1], -sc2[0], sc2[0], sc2[1]); + float2x2 rm3 = float2x2(sc3[1], -sc3[0], sc3[0], sc3[1]); + + // rotation matrix for tangent vectors + float3x3 trm1 = axis_rotation_matrix(state::normal(), -rrr1); + float3x3 trm2 = axis_rotation_matrix(state::normal(), -rrr2); + float3x3 trm3 = axis_rotation_matrix(state::normal(), -rrr3); + + // randomized scale + float2 sr = scale_range; + float2 scale1 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand1.y), scale); + float2 scale2 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand2.y), scale); + float2 scale3 = math::lerp(1.0, math::lerp(sr.x, sr.y, rand3.y), scale); + + // randomized offset + float2 offset1 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand1 * offset); + float2 offset2 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand2 * offset); + float2 offset3 = math::lerp(float2(offset_range.x), float2(offset_range.y), rand3 * offset); + + // get coord + float2 st1 = ((coord - ctr1) * rm1 / scale1) + ctr1 + offset1; + float2 st2 = ((coord - ctr2) * rm2 / scale2) + ctr2 + offset2; + float2 st3 = ((coord - ctr3) * rm3 / scale3) + ctr3 + offset3; + + hextile_data tile_data = hextile_data(st1, st2, st3, float3(w1, w2, w3), trm1, trm2, trm3); + + return tile_data; +} + +export color hextiling_file_texture( + uniform texture_2d texture + [[ + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Bitmap texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + color default_color = color(0.0) + [[ + anno::display_name("Default color"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback color returned when no valid texture is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float falloff_contrast = 0.5 + [[ + anno::display_name("Falloff Contrast"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(11), + anno::description("Controls how strongly luminance influences blending weights.") + ]] +) +[[ + anno::display_name("Hextiling Bitmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_color; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup texture + color c1 = tex::lookup_color(texture, tile_data.coord1); + color c2 = tex::lookup_color(texture, tile_data.coord2); + color c3 = tex::lookup_color(texture, tile_data.coord3); + + // luminance as weight + float3 cw = float3(math::luminance(c1), math::luminance(c2), math::luminance(c3)); + cw = math::lerp(float3(1.0), cw, float3(falloff_contrast)); + + // blend weights + float3 w = cw * math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + color out_color = w.x * c1 + w.y * c2 + w.z * c3; + + return out_color; +} + +export float3 hextiling_normalmap_texture( + uniform texture_2d texture + [[ + anno::usage("normal"), + anno::display_name("Bitmap file"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(0), + anno::description("Normal map texture sampled by the hextiling algorithm.") + ]], + uniform int texture_space = 0 + [[ + anno::display_name("UV space index"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(1), + anno::description("UV set index used for texture-coordinate lookup.") + ]], + float3 default_normal = state::normal() + [[ + anno::display_name("Default normal"), + anno::in_group("Bitmap parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(2), + anno::description("Fallback normal returned when no valid normal map is provided.") + ]], + float2 repeat = float2(1.0, 1.0) + [[ + anno::display_name("Tiling"), + anno::in_group("Placement"), + icon(".icons/hextiling.svg"), + anno::ui_order(3), + anno::description("UV tiling multiplier applied before hextiling.") + ]], + float rotation = 1.0 + [[ + anno::display_name("Rotation"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(4), + anno::description("Random rotation amount; 0 disables random rotation and 1 uses the full rotation range.") + ]], + float2 rotation_range = float2(0.0, 360.0) + [[ + anno::display_name("Rotation Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(5), + anno::description("Minimum and maximum random rotation in degrees.") + ]], + float scale = 1.0 + [[ + anno::display_name("Scale"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(6), + anno::description("Random scale amount; 0 disables random scaling and 1 uses the full scale range.") + ]], + float2 scale_range = float2(0.5, 2.0) + [[ + anno::display_name("Scale Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(7), + anno::description("Minimum and maximum random tile scale.") + ]], + float offset = 1.0 + [[ + anno::display_name("Offset"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(8), + anno::description("Random offset amount; 0 disables random offsets and 1 uses the full offset range.") + ]], + float2 offset_range = float2(0.0, 1.0) + [[ + anno::display_name("Offset Range"), + anno::in_group("Randomization"), + icon(".icons/hextiling.svg"), + anno::ui_order(9), + anno::description("Minimum and maximum random UV offset applied per tile.") + ]], + float falloff = 0.5 + [[ + anno::display_name("Falloff"), + anno::in_group("Blending"), + icon(".icons/hextiling.svg"), + anno::soft_range(0.0, 1.0), + anno::ui_order(10), + anno::description("Controls how quickly tile blending transitions between neighboring tiles.") + ]], + float strength = 1.0 + [[ + anno::display_name("Strength"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(11), + anno::soft_range(0.0, 1.0), + anno::description("Strength multiplier applied to sampled normal-map perturbations.") + ]], + uniform bool flip_g = false + [[ + anno::display_name("Flip V"), + anno::in_group("Normal map parameters"), + icon(".icons/hextiling.svg"), + anno::ui_order(12), + anno::description("Flips the green (Y) channel of the sampled normal maps.") + ]] +) +[[ + anno::display_name("Hextiling Normalmap texture"), + anno::description("Allows infinite texturing without obvious repeat patterns."), + anno::thumbnail(".thumbs/file_texture.png"), + anno::in_group("Texturing", "Hextiling"), + icon(".icons/hextiling.svg"), + anno::ui_order(32), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT) +]] +{ + if (!tex::texture_isvalid(texture)) + return default_normal; + + + float3 uvw = state::texture_coordinate(texture_space); + float2 coord = float2(uvw.x, uvw.y) * repeat; + + // get triangle coord + hextile_data tile_data = hextile_coord( + coord: coord, + rotation: rotation, + rotation_range: rotation_range, + scale: scale, + scale_range: scale_range, + offset: offset, + offset_range: offset_range + ); + + // lookup normalmap + float3 nm1 = tex::lookup_float3(texture, tile_data.coord1); + float3 nm2 = tex::lookup_float3(texture, tile_data.coord2); + float3 nm3 = tex::lookup_float3(texture, tile_data.coord3); + nm1.y = flip_g ? 1.0 - nm1.y : nm1.y; + nm2.y = flip_g ? 1.0 - nm2.y : nm2.y; + nm3.y = flip_g ? 1.0 - nm3.y : nm3.y; + + // transform to geometry normals + nm1 = 2.0 * nm1 - 1.0; + nm2 = 2.0 * nm2 - 1.0; + nm3 = 2.0 * nm3 - 1.0; + float3 sn = state::normal(); + float3 tu1 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat1 * strength; + float3 tu2 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat2 * strength; + float3 tu3 = state::texture_tangent_u(0) * tile_data.tangent_rot_mat3 * strength; + float3 tv1 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat1 * strength; + float3 tv2 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat2 * strength; + float3 tv3 = state::texture_tangent_v(0) * tile_data.tangent_rot_mat3 * strength; + float3 n1 = math::normalize(tu1 * nm1.x + tv1 * nm1.y + sn * nm1.z); + float3 n2 = math::normalize(tu2 * nm2.x + tv2 * nm2.y + sn * nm2.z); + float3 n3 = math::normalize(tu3 * nm3.x + tv3 * nm3.y + sn * nm3.z); + + // belnd weights + float3 w = math::pow(tile_data.weights, 7.0); + w /= (w.x + w.y + w.z); + + // apply s-curve gain + if (falloff != 0.5) + { + w.x = schlick_gain(w.x, falloff); + w.y = schlick_gain(w.y, falloff); + w.z = schlick_gain(w.z, falloff); + w /= (w.x + w.y + w.z); + } + + // blend + float3 out_normal = gradient_blend_3_normals(n1, w.x, n2, w.y, n3, w.z); + + return out_normal; +} + +//endgroup + +//material section----------------------------------------------------------------------------------------------- + +//group Simple materials + +export material diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead a powdery appearance") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple diffuse"), + anno::description("A basic diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(0), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::diffuse_reflection_bsdf( + roughness: roughness, + tint: diffuse_color + ) + ) + ) +); + +export material dusty_diffuse( + color diffuse_color = color(.8) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Dusty diffuse"), + anno::description("A dusty diffuse material"), + anno::thumbnail(".thumbs/diffuse.png"), + anno::in_group("Materials", "Diffuse"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic")) +]] + = material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::dusty_diffuse_reflection_bsdf( + tint: diffuse_color + ) + ) + ) +); + +export material scratched_metal_v2( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::ui_order(1), + anno::description("The color of the metal") + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::ui_order(3), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::ui_order(4), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::ui_order(5), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::ui_order(6), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::ui_order(7), + anno::description("Attach bump or normal maps here") + ]], + color edge_color = color(1.0) + [[ + anno::display_name("Edge color"), + anno::ui_order(2), + anno::description("The color of the metal towards the edge") + ]] +) +[[ + anno::display_name("Metal"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::in_group("Materials"), + anno::ui_order(1), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + complex_ior ior = artistic_metal_to_complex_ior(metal_color, edge_color); + bsdf glossy_bsdf = df::fresnel_factor( + ior: ior.n, + extinction_coefficient: ior.k, + base: df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ) + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic_v2( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.2 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::in_group("Materials"), + anno::ui_order(2), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness*roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material retroreflective( + color base_color = color(.2,.03,.03) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + color reflection_color = color(.8,.8,.03) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the retroreflection"), + anno::ui_order(2) + ]], + float roughness = 0.15 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + float normal_reflectivity = .05 + [[ + anno::display_name("Reflection weight facing"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for geometry facing the viewer"), + anno::ui_order(4) + ]], + float grazing_reflectivity = 1. + [[ + anno::display_name("Reflection weight edge"), + anno::hard_range(0.0,1.), + anno::description("Reflectivity control for the reflectivity at geometry edges"), + anno::ui_order(5) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Retroreflective"), + anno::description("A material with a retroreflective component, works well for road signs and retroreflective stickers"), + anno::thumbnail(".thumbs/retroreflective.png"), + anno::in_group("Materials"), + anno::ui_order(3), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","retroreflective","roadsign","stone")) +]] + = let{ + bsdf glossy_bsdf = df::backscattering_glossy_reflection_bsdf( + tint: reflection_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::custom_curve_layer( + normal_reflectivity: 1.-normal_reflectivity, + grazing_reflectivity: 1.-grazing_reflectivity, + base: glossy_bsdf, + layer: df::diffuse_reflection_bsdf( + roughness: 1.0, + tint: base_color + ), + normal: normal + ) + ) + ) +); + +export material flex_material_v2( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + float is_metal = 0.0 + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If 1.0, reflection will be colored and independent of view direction. If 0.0, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.3 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object compared to its diffuse reflectivity."), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass."), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\" (m)."), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85"), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(5), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness*reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness*transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = df::weighted_layer( + is_metal, + df::weighted_layer( + weight: reflectivity, + layer: df::directional_factor(base_color,color(1.0),5.,glossy_bsdf), + base: add_transparency, + normal: normal + ), + df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ) + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass_v2( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(6), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_transmission_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent_v2( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(7), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass_v2( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::in_group("Materials", "Glass"), + anno::ui_order(8), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf glossy_bsdf_transmission = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness*roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent_v2( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::in_group("Materials", "Translucent"), + anno::ui_order(9), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness*roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +//endgroup + +//group Modifier materials + +export material blend( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float weight = 0. + [[ + anno::display_name("Blend weight"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]] +) +[[ + anno::display_name("Blend materials"), + anno::description("Blend characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/blend.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/generic_blend.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = let { + float inv_weight = 1.0f - weight; +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: material_emission( + mode: base.surface.emission.mode, //cant vary + intensity: math::lerp(base.surface.emission.intensity,blend.surface.emission.intensity, weight), + emission: df::unbounded_mix( + df::edf_component[] + ( + df::edf_component(inv_weight,base.surface.emission.emission), + df::edf_component(weight,blend.surface.emission.emission) + ) + ) + ) + ), + volume: material_volume( + scattering: df::unbounded_mix( + df::vdf_component[] + ( + df::vdf_component(inv_weight,base.volume.scattering), + df::vdf_component(weight,blend.volume.scattering) + ) + ), + absorption_coefficient: math::lerp(base.volume.absorption_coefficient,base.volume.absorption_coefficient,weight), + scattering_coefficient: math::lerp(base.volume.scattering_coefficient,base.volume.scattering_coefficient,weight), + emission_intensity: math::lerp(base.volume.emission_intensity,blend.volume.emission_intensity, weight) + + ), + ior: base.ior, //can't vary + thin_walled: base.thin_walled, //can't vary + geometry: material_geometry( + displacement: math::lerp(base.geometry.displacement, blend.geometry.displacement, weight), + cutout_opacity: math::lerp(base.geometry.cutout_opacity, blend.geometry.cutout_opacity, weight), + normal: blend_normals(base.geometry.normal, inv_weight, blend.geometry.normal, weight) + ) +); + +export material twosided( + material front = scratched_plastic_v2() + [[ + anno::display_name("Front material"), + anno::description("The material on the front faces.") + ]], + material back = scratched_metal_v2() + [[ + anno::display_name("Back material"), + anno::description("The material on the back faces.") + ]] +) +[[ + anno::display_name("Two-sided materials"), + anno::description("Allows you to apply a material to front and back surfaces."), + anno::thumbnail(".thumbs/twosided.png"), + anno::in_group("Material modifiers"), + icon(".icons/two_sided_materials.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + thin_walled: true, + ior: front.ior, + surface: front.surface, + backface: back.surface, + geometry: front.geometry +); + +export material surface_falloff( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material the blend is based on") + ]], + material blend = scratched_metal_v2() + [[ + anno::display_name("Blend Material"), + anno::description("Surface properties to use for the blend") + ]], + float facing_weight = 0.0 + [[ + anno::display_name("Blend weight facing"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float edge_weight = 1.0 + [[ + anno::display_name("Blend weight edge"), + anno::hard_range(0.0,1.), + anno::description("Blend weight or mask texture") + ]], + float blend_bias = 1. + [[ + anno::display_name("Blend bias"), + anno::soft_range(0.0,10.), + anno::description("Controls how fast the transition should happen. 5.0 results in fresnel like transition.") + ]] +) +[[ + anno::display_name("Surface falloff"), + anno::description("Blend surface characteristics of 2 materials or mask them using a texture"), + anno::thumbnail(".thumbs/surface_falloff.png"), + anno::in_group("Material modifiers", "Blend"), + icon(".icons/surface_falloff.svg"), + anno::ui_order(15), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(combiner_material), + anno::key_words(string[]("combiner","generic")) +]] + = material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: 1., + exponent: blend_bias, + normal_reflectivity: facing_weight, + grazing_reflectivity: edge_weight, + layer: blend.surface.scattering, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_clearcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_clear_coating.svg"), + anno::ui_order(16), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_thinfilm( + material base = scratched_metal_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get shows a thin film effect") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("The IOR of the thin film interface") + ]], + float thickness = 400.0 + [[ + anno::display_name("Thickness"), + anno::soft_range(10.0,5000.0), + anno::description("Thickness of the thin film in nm") + ]] +) +[[ + anno::display_name("Apply thin film"), + anno::description("Apply thin film to an existing material"), + anno::thumbnail(".thumbs/apply_thinfilm.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_film.svg"), + anno::ui_order(17), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::thin_film( + ior: color(ior), + thickness: thickness, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat_v2( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_thin_metal_coating.svg"), + anno::ui_order(18), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::microfacet_ggx_smith_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness*roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_dustcover( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color dust_color = color(.7) + [[ + anno::display_name("Dust color"), + anno::description("The color of the dust") + ]], + float visibility = 1. + [[ + anno::display_name("Dust density"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the cover") + ]], + uniform float dust_density = .5 + [[ + anno::display_name("Dust amount"), + anno::hard_range(.01,1), + anno::description("How dusty the material is") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Apply a cover of dust"), + anno::description("Apply a diffuse cover of dust or dirt"), + anno::thumbnail(".thumbs/apply_dustcover.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_dust_cover.svg"), + anno::ui_order(19), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf dust_bsdf = df::diffuse_reflection_bsdf( + roughness: 1., + tint: dust_color + ); +} in material( + surface: material_surface( + scattering: df::custom_curve_layer( + weight: visibility, + normal_reflectivity: dust_density*dust_density*dust_density, + exponent: (1.05-dust_density)*2., + normal: normal, + layer: dust_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_colorfalloff_v2( + material base = scratched_metal_v2(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + uniform color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("Color 1 (facing direction)") + ]], + uniform color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("Color 2") + ]], + uniform color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("Color 3") + ]], + uniform color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("Color 4") + ]], + uniform color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("Color 5 (object edges)") + ]] +) +[[ + anno::display_name("Apply a color falloff"), + anno::description("Makes the color view dependent"), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/apply_color_falloff.svg"), + anno::ui_order(20), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//JAN: TODO fix from here +export material apply_metallicflakes( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a flake layer applied") + ]], + color flake_color = color(.9,.7,.5) + [[ + anno::display_name("Color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.5 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = 0.5 + [[ + anno::display_name("Flake opacity"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]] +) +[[ + anno::display_name("Apply flake coating"), + anno::description("Apply layer of metallic flakes to an existing material"), + anno::thumbnail(".thumbs/apply_metallicflakes.png"), + anno::in_group("Material modifiers", "Coating"), + icon(".icons/apply_flake_coating.svg"), + anno::ui_order(21), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flake_paint( + color base_color = color(.3,.01,.01) + [[ + anno::display_name("Base color"), + anno::description("The color of the base paint") + ]], + color flake_color = color(.6,1,.1) + [[ + anno::display_name("Flake color"), + anno::description("The color of the flakes") + ]], + float roughness = 0.15 + [[ + anno::display_name("Flake roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metallic flakes") + ]], + uniform float size = 1. + [[ + anno::display_name("Flake size"), + anno::description("Determines size of the metallic flakes, in mm") + ]], + uniform float amount = 0.4 + [[ + anno::display_name("Flake amount"), + anno::hard_range(0.0,1.), + anno::description("Determines amount of visible metallic flakes") + ]], + uniform float opacity = .8 + [[ + anno::display_name("Flake weight"), + anno::hard_range(0.0,1.), + anno::description("Determines visibility of the metallic flakes") + ]], + uniform float bump = 1. + [[ + anno::display_name("Flake orientation randomness"), + anno::description("Larger numbers will increase the sparkle radius around highlights") + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat") + ]], + float coat_roughness = 0.0 + [[ + anno::display_name("Coat roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat") + ]], + float3 coat_bump = state::normal() + [[ + anno::display_name("Coat bump"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Flaky paint"), + anno::description("A multi layer paint material containing flakes"), + anno::thumbnail(".thumbs/flake_paint.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials"), + anno::ui_order(14), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("complex","carpaint")) +]] + = let{ + float3 flake_normal = base::flake_noise_bump_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + strength: bump, + scale: size * 0.001 + ); + float flake_opacity = base::flake_noise_texture( + uvw: base::coordinate_source(coordinate_system: base::texture_coordinate_object), + intensity: opacity, + scale: size * 0.001, + density: amount + ).mono; + + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: flake_color + ); +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: coat_bump, + layer: df::simple_glossy_bsdf(roughness_u: coat_roughness), + base: df::weighted_layer( + normal: flake_normal, + weight: flake_opacity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf(tint: base_color) + ) + ) + ), + thin_walled: true +); + +export material add_cutout( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a cut-out") + ]], + float cutout = 1.0 + [[ + anno::display_name("Cutout"), + anno::hard_range(0.0,1.0), + anno::description("Determines where the object is visible") + ]] +) [[ + anno::display_name("Add cut-outs"), + anno::description("Adds cut-outs to existing materials. Also forces material to be thin-walled. Good for modeling leaves, grass or fences."), + anno::thumbnail(".thumbs/add_cutout.png"), + anno::in_group("Material modifiers"), + icon(".icons/add_cutouts.svg"), + anno::ui_order(22), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: true, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: cutout + ) +); + +export material add_simple_sticker( + color diffuse_color = color(.5) + [[ + anno::display_name("Sticker color"), + anno::description("The color of the material"), + anno::ui_order(2) + ]], + float roughness = 0.05 + [[ + anno::display_name("Sticker roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(3) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("Sticker IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Sticker reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(4) + ]], + float3 sticker_normal = state::normal() + [[ + anno::display_name("Sticker bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]], + float sticker_mask = 0.0 + [[ + anno::display_name("Sticker mask"), + anno::hard_range(0.0,1.0), + anno::description("Determines extent of the sticker"), + anno::ui_order(5) + ]], + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a sticker added"), + anno::ui_order(1) + ]] +) [[ + anno::display_name("Add simple sticker"), + anno::description("A quick way for adding simple stickers to a material. The sticker is a simple dielectric and needs a mask to define its extent."), + anno::thumbnail(".thumbs/add_simple_sticker.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_simple_sticker.svg"), + anno::ui_order(23), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = let{ + material blend_material = blend( + blend: scratched_plastic_v2( + diffuse_color: diffuse_color, + roughness: roughness, + ior: ior, + reflectivity: reflectivity, + normal: sticker_normal), + base: base, + weight: sticker_mask + ); +} in material( + surface: blend_material.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_globalbump( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bump"), + anno::description("An additional global bump map for the material. Local bump map of the base material is preserved.") + ]] +) [[ + anno::display_name("Add global bumpmap"), + anno::description("Adds global bumpmap to existing materials. Local bump map of the base material is preserved."), + anno::thumbnail(".thumbs/add_globalbump.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_global_bumpmap.svg"), + anno::ui_order(24), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get a bump map") + ]], + float displacement = 0.0 + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results.") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add displacement"), + anno::description("Adds displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: displacement*displacement_scale*state::scene_units_per_meter()*state::normal(), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_vector_displacement( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get displacement") + ]], + float3 displacement = float3(0.0) + [[ + anno::display_name("Displacement amount"), + anno::description("Attach displacement texture here. Note that the object needs to be set up correctly to have good displacement results") + ]], + uniform displacement_vector_space space = displacement_vector_tangent_space + [[ + anno::display_name("Displacement vector mode"), + anno::description("Specify the space of the vector dispacement map") + ]], + uniform float displacement_scale = 1.0 + [[ + anno::display_name("Displacement scale"), + anno::description("A global scale factor for the displacement amount") + ]] +) [[ + anno::display_name("Add vector displacement"), + anno::description("Adds vector displacement to existing materials"), + anno::thumbnail(".thumbs/add_displacement.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Displacement"), + icon(".icons/add_vector_displacement.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: state::scene_units_per_meter()*transform_displacement_vector(displacement, space, displacement_scale), + normal: base.geometry.normal, + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_round_edges( + material base = scratched_plastic_v2() + [[ + anno::display_name("Base material"), + anno::description("The material that will get round edges") + ]], + uniform float round_edges_radius = 0.02 + [[ + anno::display_name("Round edge radius"), + anno::description("Influence radius around the edges in meters") + ]], + uniform float round_edges_roundness = 1.0 + [[ + anno::display_name("Round edge roundness"), + anno::description("Determines how round the edge will look"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false + [[ + anno::display_name("Round edge across materials"), + anno::description("Normal smoothing happens only between facets of equal material, unless + this parameter is set true, in which case the smoothing happens between + facets irrespective of their materials") + ]] +) [[ + anno::display_name("Add round edges"), + anno::description("Adds round edges to existing materials"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers"), + icon(".icons/add_round_edges.svg"), + anno::ui_order(25), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic")) +]] = material( + surface: base.surface, + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: material_geometry( + displacement: base.geometry.displacement, + normal: state::rounded_corner_normal( + radius: round_edges_radius, + roundness: round_edges_roundness, + across_materials: round_edges_across_materials + ), + cutout_opacity: base.geometry.cutout_opacity + ) +); + +export material add_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add emission"), + anno::description("Adds emission to a material"), + anno::thumbnail(".thumbs/add_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_emission.svg"), + anno::ui_order(26), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: unit_intensity*tint*unit_scale, //for this mode, tint is assumes to be a color filter absorbing light + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material add_thermal_emission( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get emission added") + ]], + uniform float temperature = 6500. + [[ + anno::display_name("Temperature"), + anno::description("The color temperature of the light in Kelvin") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Add thermal emission"), + anno::description("Adds emission to a material, color is based on a \"color temperature\""), + anno::thumbnail(".thumbs/add_thermal_emission.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Material modifiers", "Emission"), + icon(".icons/add_thermal_emission.svg"), + anno::ui_order(27), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + suitable_as_light(), + anno::key_words(string[]("modifier","generic")) +]] = +let { + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; + color emission_color = math::blackbody(temperature); + + color scaled_intensity = unit_intensity * (emission_color / math::luminance(emission_color));} +in material( + surface: material_surface( + scattering: base.surface.scattering, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: scaled_intensity, + mode: imode + ) + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); +//endgroup + +/**-*/ + +//group Emissive materials + +export material light_omni ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Diffuse emission"), + anno::description("Emissive material emitting in all directions"), + anno::thumbnail(".thumbs/light_omni.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::ui_order(5000), + anno::hidden(), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*math::PI; //diffuse emission is per projected hemisphere + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::diffuse_edf(), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_spot ( + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1000 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(), //deprecated + anno::description("Modeling unit to meter conversion factor") + ]], + uniform float spot_exponent = 30 + [[ + anno::display_name("Spot focus"), + anno::description("larger values lead to more focused spotlights") + ]], + uniform emission_type unit = lumen_m2 + [[ + anno::display_name("Unit for emission"), + anno::description("The physical unit of \"Intensity\"") + ]] +) [[ + anno::display_name("Spotlight emission"), + anno::description("Emissive material emitting focused in one direction"), + anno::thumbnail(".thumbs/light_spot.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5051), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = +let{ + //since this is a spotlight, we need the apex angle to convert from candela to lumen + //http://www.compuphase.com/electronics/candela_lumen.htm + //uniform float cos_apexangle_2 = math::pow(0.5,1./spot_exponent); //spot exponent 0 ->4pi + //uniform float apexfactor = 2*math::PI*(1.0-cos_apexangle_2); + + //correct integral + uniform float factor = (spot_exponent == 0)? 4*math::PI: 2*math::PI/(spot_exponent+1); + uniform float unit_intensity = (unit==lumen || unit==lumen_m2)?intensity:intensity*factor; + uniform intensity_mode imode = (unit==lumen || unit==candela)?intensity_power:intensity_radiant_exitance; +} in material ( + surface: material_surface ( + emission: material_emission ( + emission: df::spot_edf(exponent: spot_exponent,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*unit_intensity*unit_scale, + mode: imode + ) + ) +); + +export material light_ies ( + uniform light_profile profile + [[ + anno::display_name("IES light profile data"), + anno::description("Data to describe the distribution of the light") + ]], + color tint = color(1.) + [[ + anno::display_name("Color"), + anno::description("The color of the light") + ]], + uniform float intensity = 1 + [[ + anno::display_name("Intensity"), + anno::description("The brightness of the light source") + ]], + uniform float unit_scale = 1. + [[ + anno::display_name("Unit scale"), + anno::hidden(),//deprecated + anno::description("Modeling unit to meter conversion factor") + ]] +) [[ + anno::display_name("IES file based emission"), + anno::description("Emissive material emitting as described in an IES file"), + anno::thumbnail(".thumbs/light_ies.png"), + anno::author("NVIDIA Corporation"), + anno::in_group("Materials, lights"), + anno::hidden(), + anno::ui_order(5052), + anno::copyright_notice(COPYRIGHT), + anno::key_words(string[]("lightsource")), + suitable_as_light() +]] = material ( + surface: material_surface ( + emission: material_emission ( + emission: df::measured_edf(profile: profile,global_distribution: true, global_frame: float3x3(1.,0,0, 0,1.,0., 0.,0,-1) ), + intensity: tint*intensity*unit_scale + ) + ) +); + +//endgroup + +//group Deprecated + +//deprecated functionality=========================================================================================== +export annotation ui_position(int position); +export annotation typical_object_size(float size); + +export material metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple metal, deprecated"), + anno::description("A basic metallic material"), + anno::thumbnail(".thumbs/metal.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material") + ]], + float roughness = 0.25 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Simple plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic"), + anno::thumbnail(".thumbs/plastic.png"), + anno::author("NVIDIA Corporation"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_metal( + color metal_color = color(.9) + [[ + anno::display_name("Color"), + anno::description("The color of the metal") + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + float glossy_weight = .9 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Intensity of highlights and glossy reflections and highlights") + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight") + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees.") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Metal , deprecated"), + anno::description("A metallic material with stretched reflections"), + anno::thumbnail(".thumbs/scratched_metal.png"), + anno::hidden(), + //anno::deprecated("Use scratched_metal_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","metal")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: metal_color, + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::weighted_layer( + weight: glossy_weight, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: metal_color + ), + normal: normal + ) + ) + ) +); + +export material scratched_plastic( + color diffuse_color = color(.5) + [[ + anno::display_name("Color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float roughness = 0.05 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(2) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Anisotropy"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(4) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(5) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity"), + anno::ui_order(6) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Additional Reflectivity control"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(7) + ]] +) +[[ + anno::display_name("Plastic, deprecated"), + anno::description("A basic dielectric, works for everything opaque that is not metallic. Supports stretched highlights."), + anno::thumbnail(".thumbs/scratched_plastic.png"), + anno::hidden(), + //anno::deprecated("Use scratched_plastic_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","plastic","wood","stone")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); +} in material( + thin_walled: true, + surface: material_surface( + scattering: df::weighted_layer( + weight: 1., + normal: normal, + layer: df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: df::diffuse_reflection_bsdf( + roughness: 0.0, + tint: diffuse_color + ), + normal: normal + ) + ) + ) +); + +export material apply_colorfalloff( + material base = scratched_metal(metal_color: color(1.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied") + ]], + color color_0 = color(1.,0.,0.) + [[ + anno::display_name("Color 1"), + anno::description("The color of the dust") + ]], + color color_1 = color(0.,1.,0.) + [[ + anno::display_name("Color 2"), + anno::description("The color of the dust") + ]], + color color_2 = color(0.,0.,1.) + [[ + anno::display_name("Color 3"), + anno::description("The color of the dust") + ]], + color color_3 = color(1.,0.,0.) + [[ + anno::display_name("Color 4"), + anno::description("The color of the dust") + ]], + color color_4 = color(0.,1.,0.) + [[ + anno::display_name("Color 5"), + anno::description("The color of the dust") + ]] +) +[[ + anno::display_name("Apply a color falloff, deprecated"), + anno::description("Makes the color view dependent"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + anno::thumbnail(".thumbs/apply_colorfalloff.png"), + anno::hidden(), + //anno::deprecated("Use apply_colorfalloff_v2 instead"), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = material( + surface: material_surface( + scattering: df::measured_curve_factor( + curve_values: color[](color_0,color_1,color_2,color_3,color_4), + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material flex_material( + color base_color = color(.5) + [[ + anno::display_name("Base color"), + anno::in_group("Base"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + float diffuse_roughness = 0.0 + [[ + anno::display_name("Diffuse roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to a more \"powdery\" look"), + anno::ui_order(2) + ]], + uniform bool is_metal = false + [[ + anno::display_name("Metallic material"), + anno::in_group("Base"), + anno::description("If true, reflection will be colored and independent of view direction. If false, reflection will be white and direction dependent. Directional dependence is in this case based on the IOR (Fresnel effect)."), + anno::ui_order(3) + ]], + float reflectivity = 1.0 + [[ + anno::display_name("Reflection weight"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Controls the amount of reflection"), + anno::ui_order(5) + ]], + float reflection_roughness = 0.1 + [[ + anno::display_name("Reflection roughness"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::ui_order(4) + ]], + float anisotropy = 0.0 + [[ + anno::display_name("Reflection anisotropy"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Higher values will stretch the highlight"), + anno::ui_order(6) + ]], + float anisotropy_rotation = 0.0 + [[ + anno::display_name("Anisotropy rotation"), + anno::in_group("Base"), + anno::hard_range(0.0,1.), + anno::description("Changes the orientation of the anisotropy. A value of 1 will rotate the orientation 360 degrees."), + anno::ui_order(7) + ]], + float transparency = 0.0 + [[ + anno::display_name("Transmission weight"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("Weights how much light passes through the object vs. its diffuse reflectivity"), + anno::ui_order(12) + ]], + color transmission_color = color(1.) + [[ + anno::display_name("Transmission color"), + anno::in_group("Transmission"), + anno::description("Color effect for transmission independent of thickness of the object, similar to stained glass"), + anno::ui_order(8) + ]], + uniform color volume_color = color(1.0) + [[ + anno::display_name("Volume color"), + anno::in_group("Transmission"), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at \"Volume reference distance\"(m)"), + anno::ui_order(9) + ]], + float transmission_roughness = 0.0 + [[ + anno::display_name("Transmission roughness"), + anno::in_group("Transmission"), + anno::hard_range(0.0,1.), + anno::description("higher values lead to objects seen through the material to appear blurry"), + anno::ui_order(11) + ]], + uniform float base_thickness = 0.1 + [[ + anno::display_name("Volume reference distance"), + anno::in_group("Transmission"), + anno::soft_range(0.0,10.0), + anno::description("If the material is not \"Thin walled\", \"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(10) + ]], + uniform float ior = 1.5 + [[ + anno::display_name("IOR"), + anno::in_group("Global"), + anno::soft_range(1.0,4.0), + anno::description("Determines refraction in the volume. It also influences the reflectivity for materials that are not metallic."), + anno::ui_order(14) + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin walled"), + anno::in_group("Global"), + anno::description("Thin walled materials do not refract and do not have volume effects. Good for soap bubbles or window glass."), + anno::ui_order(13) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::in_group("Global"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(16) + ]], + uniform float abbe_number = 0.0 + [[ + anno::in_group("Global"), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off, Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(15) + ]] +) +[[ + anno::display_name("Flexible material model, deprecated"), + anno::description("A complex material that can be configured to a wide variety of looks"), + anno::thumbnail(".thumbs/flex_material.png"), + anno::hidden(), + //anno::deprecated("Use flex_material_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(complex_material), + anno::key_words(string[]("generic","complex")) +]] + = let{ + base::anisotropy_return anisotropy_values = base::anisotropy_conversion( + roughness: reflection_roughness, + anisotropy: anisotropy, + anisotropy_rotation: anisotropy_rotation + ); + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: is_metal? base_color: color(1.), + roughness_u: anisotropy_values.roughness_u, + roughness_v: anisotropy_values.roughness_v, + tangent_u: anisotropy_values.tangent_u + ); + bsdf diffuse_bsdf = df::diffuse_reflection_bsdf( + tint: base_color, + roughness: diffuse_roughness + ); + bsdf transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: transmission_roughness + ); + bsdf add_transparency = df::weighted_layer( + weight: transparency, + layer: transmission_bsdf, + base: diffuse_bsdf, + normal: normal + ); + bsdf add_reflection = is_metal? df::weighted_layer( + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ): df::fresnel_layer( + ior: ior, + weight: reflectivity, + layer: glossy_bsdf, + base: add_transparency, + normal: normal + ); + bsdf add_normal = df::weighted_layer( + normal: normal, + weight: 1., + layer: add_reflection + ); +} in material( + thin_walled: thin_walled, + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number), + surface: material_surface( + scattering: add_normal + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ) +); + +export material thin_glass( + color glass_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin glass, deprecated"), + anno::description("A basic transmissive dielectric without refraction or volume"), + anno::thumbnail(".thumbs/thin_glass.png"), + anno::hidden(), + //anno::deprecated("Use thin_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_transmission_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: glass_color, + roughness_u: roughness + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + layer: glossy_transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) +); + +export material thin_translucent( + color surface_color = color(.95) + [[ + anno::display_name("Diffuse color"), + anno::description("The color of the material") + ]], + color translucent_color = color(.95) + [[ + anno::display_name("Translucence color"), + anno::description("The color of the volume of the material") + ]], + float translucency = 0.5 + [[ + anno::display_name("Translucence weight"), + anno::hard_range(0.0,1.), + anno::description("Fraction of the incoming light that should be visible on the backside") + ]], + float roughness = 0.0 + [[ + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity") + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]] +) +[[ + anno::display_name("Thin translucent, deprecated"), + anno::description("A diffuse transmissive dielectric material"), + anno::thumbnail(".thumbs/thin_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thin_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","leaves","paper","sheets")) +]] + = let{ + bsdf glossy_reflection_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::diffuse_transmission_bsdf( + tint: translucent_color + ); + bsdf base_bsdf = df::diffuse_reflection_bsdf( + tint: surface_color + ); +} in material( + thin_walled: true, + surface: material_surface( + df::fresnel_layer( + ior: ior, + normal: normal, + layer: glossy_reflection_bsdf, + base: df::weighted_layer( + weight: translucency, + normal: normal, + base: base_bsdf, + layer: df::weighted_layer( + layer: transmission_bsdf, + normal: normal, + weight: 1. + ) + ) + ) + ) +); + +export material thick_glass( + color transmission_color = color(1.0) + [[ + anno::ui_order(1), + anno::display_name("Transmission color"), + anno::description("Colors the light entering the volume, similar to stained glass") + ]], + uniform color glass_color = color(.95) + [[ + anno::ui_order(2), + anno::display_name("Volume color"), + anno::description("The color of the glass body") + ]], + float roughness = 0.0 + [[ + anno::ui_order(4), + anno::display_name("Roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections") + ]], + uniform float ior = 1.4 + [[ + anno::ui_order(5), + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction") + ]], + uniform float base_thickness = .1 + [[ + anno::ui_order(3), + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here.") + + ]], + float3 normal = state::normal() + [[ + anno::ui_order(7), + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here") + ]], + uniform float abbe_number = 0.0 + [[ + anno::ui_order(6), + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0 switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0) + ]] +) +[[ + anno::display_name("Thick glass, deprecated"), + anno::description("A basic transmissive dielectric with refraction and coloring in the volume"), + anno::thumbnail(".thumbs/thick_glass.png"), + anno::hidden(), + //anno::deprecated("Use thick_glass_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","glass")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: transmission_color, + roughness_u: roughness + ); +} in material( + thin_walled: false, + surface: material_surface( + df::weighted_layer( + normal: normal, + weight: 1., + layer: df::fresnel_layer( + layer: glossy_bsdf, + base: glossy_bsdf_transmission, + ior: ior, + normal: normal + ) + ) + ), + volume: material_volume( + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material thick_translucent( + color transmission_color = color(.95) + [[ + anno::display_name("Transmission color"), + anno::description("The color of the material"), + anno::ui_order(1) + ]], + uniform color volume_color = color(.95) + [[ + anno::display_name("Volume color"), + anno::description("The color of the volume at \"Volume reference distance\""), + anno::ui_order(2) + ]], + uniform float volume_scattering = 0.5 + [[ + anno::display_name("Volume scattering"), + anno::hard_range(0.0,.99999), + anno::description("Amount of scattering for objects at \"Volume reference distance\""), + anno::ui_order(3) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.), + anno::description("Higher roughness values lead to bigger highlights and blurry reflections"), + anno::ui_order(5) + ]], + float reflectivity = 1. + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.), + anno::description("Overall reflectivity of the material"), + anno::ui_order(6) + ]], + uniform float base_thickness = .1 + [[ + anno::display_name("Volume reference distance"), + anno::soft_range(0.0,10.0), + anno::description("\"Volume color\" and \"Volume scattering\" will be reached at this distance (m). Enter a typical thickness of objects made of this material here."), + anno::ui_order(4) + + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(9) + ]], + uniform float ior = 1.4 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity as well as amount of refraction"), + anno::ui_order(7) + ]], + uniform float abbe_number = 0.0 + [[ + anno::display_name("Abbe number"), + anno::description("Controls dispersion. A value of 0switches dispersion off. Dispersive materials have Abbe numbers between 25 and 85."), + anno::soft_range(0.0,100.0), + anno::ui_order(8) + ]] +) +[[ + anno::display_name("Thick translucent, deprecated"), + anno::description("A subsurface scattering material"), + anno::thumbnail(".thumbs/thick_translucent.png"), + anno::hidden(), + //anno::deprecated("Use thick_translucent_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(simple_material), + anno::key_words(string[]("generic","dielectric","wax","milk")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: color(1.), + roughness_u: roughness + ); + bsdf transmission_bsdf = df::specular_bsdf( + mode: df::scatter_transmit, + tint: transmission_color + ); + +} in material( + thin_walled: false, + surface: material_surface( + df::fresnel_layer( + normal: normal, + weight: reflectivity, + ior: ior, + layer: glossy_bsdf, + base: df::weighted_layer( + normal: normal, + weight: 1., + layer: transmission_bsdf + ) + ) + ), + volume: material_volume( + scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-volume_scattering)) / - base_thickness, + absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness + ), + ior: abbe_number == 0.0?color(ior):base::abbe_number_ior(ior, abbe_number) +); + +export material apply_clearcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a clear coating applied"), + anno::ui_order(1) + ]], + uniform float ior = 1.6 + [[ + anno::display_name("IOR"), + anno::soft_range(1.0,4.0), + anno::description("Determines reflectivity of the clear coat"), + anno::ui_order(5) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the clear coat"), + anno::ui_order(3) + ]], + float visibility = 1.0 + [[ + anno::display_name("Coat visibility"), + anno::hard_range(0.0,1.0), + anno::description("Determines visibility of the clear coat"), + anno::ui_order(4) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(6) + ]], + color coat_filter_color = color(1.) + [[ + anno::display_name("Coat filter color"), + anno::description("For simulating coatings with colored resins that modulate the color of underlying layers"), + anno::ui_order(2) + ]] +) +[[ + anno::display_name("Apply clear coating, deprecated"), + anno::description("Apply clear coat to an existing material"), + anno::author("NVIDIA Corporation"), + anno::thumbnail(".thumbs/apply_clearcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_clearcoat_v2 instead"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: color(1.) + ); + color base_tint = blend_colors(color(1.), coat_filter_color, color_layer_blend, visibility).tint; +} in material( + surface: material_surface( + scattering: df::fresnel_layer( + ior: ior, + normal: normal, + weight: visibility, + layer: glossy_bsdf, + base: df::tint(tint: base_tint, base: base.surface.scattering) + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +export material apply_metalcoat( + material base = diffuse(diffuse_color: color(0.)) + [[ + anno::display_name("Base material"), + anno::description("The material that will get a metallic coating applied"), + anno::ui_order(1) + ]], + color metal_color = color(.95) + [[ + anno::display_name("Reflection color"), + anno::description("The color of the metal"), + anno::ui_order(2) + ]], + float visibility = .3 + [[ + anno::display_name("Reflection weight"), + anno::hard_range(0.0,1.0), + anno::description("The opacity of the coat"), + anno::ui_order(4) + ]], + float roughness = 0.0 + [[ + anno::display_name("Reflection roughness"), + anno::hard_range(0.0,1.0), + anno::description("Determines roughness of the metal coat"), + anno::ui_order(3) + ]], + float3 normal = state::normal() + [[ + anno::display_name("Bumps"), + anno::description("Attach bump or normal maps here"), + anno::ui_order(5) + ]] +) +[[ + anno::display_name("Apply thin metal coating, deprecated"), + anno::description("Apply metal coat to an existing material"), + anno::thumbnail(".thumbs/apply_metalcoat.png"), + anno::hidden(), + //anno::deprecated("Use apply_metalcoat_v2 instead"), + anno::author("NVIDIA Corporation"), + anno::copyright_notice(COPYRIGHT), + type_of_material(modifier_material), + anno::key_words(string[]("modifier","generic","coating")) +]] + = let{ + bsdf glossy_bsdf = df::simple_glossy_bsdf( + mode: df::scatter_reflect, + roughness_u: roughness, + tint: metal_color + ); +} in material( + surface: material_surface( + scattering: df::weighted_layer( + weight: visibility, + normal: normal, + layer: glossy_bsdf, + base: base.surface.scattering + ), + emission: base.surface.emission + ), + volume: base.volume, + ior: base.ior, + thin_walled: base.thin_walled, + geometry: base.geometry +); + +//endgroup + +/*-**/ diff --git a/unitree_z1/materials/mdl/support_definitions.mdl b/unitree_z1/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/unitree_z1/materials/mdl/support_definitions.mdl @@ -0,0 +1,4292 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.8; + +import ::anno::*; +import ::math::*; + +using .::aux_definitions import xy; +import ::state::*; +import ::scene::*; + +export using ::state import coordinate_space; //enum type +import ::tex::*; +export using ::tex import gamma_mode; //enum type +export using ::tex import wrap_mode; //enum type + +module [[ + anno::version( 1, 2, 0), + anno::display_name("NVIDIA support definitions") +]]; + +export annotation icon(string path); + + +export float data_lookup_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float(name, default_value); +} + +export float2 data_lookup_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float2(name, default_value); +} + +export float3 data_lookup_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float3(name, default_value); +} + +export float4 data_lookup_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_float4(name, default_value); +} + +export int data_lookup_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int(name, default_value); +} + +export int2 data_lookup_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int2(name, default_value); +} + +export int3 data_lookup_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int3(name, default_value); +} + +export int4 data_lookup_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_int4(name, default_value); +} + +export color data_lookup_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Varying"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_color(name, default_value); +} + +export uniform float data_lookup_uniform_float( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float default_value = float() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float(name, default_value); +} + +export uniform float2 data_lookup_uniform_float2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float2 default_value = float2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float2(name, default_value); +} + +export uniform float3 data_lookup_uniform_float3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float3 default_value = float3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform float3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float3(name, default_value); +} + +export uniform float4 data_lookup_uniform_float4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform float4 default_value = float4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup unfirom float4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_float4(name, default_value); +} + +export uniform int data_lookup_uniform_int( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int default_value = int() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int(name, default_value); +} + +export uniform int2 data_lookup_uniform_int2( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int2 default_value = int2() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int2"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int2(name, default_value); +} + +export uniform int3 data_lookup_uniform_int3( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int3 default_value = int3() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int3"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int3(name, default_value); +} + +export uniform int4 data_lookup_uniform_int4( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform int4 default_value = int4() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform int4"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_int4(name, default_value); +} + +export uniform color data_lookup_uniform_color( + uniform string name [[ + anno::description("Scene data attribute name to look up on the target mesh.") + ]], + uniform color default_value = color() [[ + anno::description("Fallback value returned when the named scene data is not present on the target mesh.") + ]] +) [[ + anno::display_name("Data lookup uniform color"), + anno::description("Looks up mesh scene data by name and returns it when present; otherwise returns the provided default value."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Data Lookup", "Uniform"), + icon(".icons/data_lookup.svg") +]] +{ + return scene::data_lookup_uniform_color(name, default_value); +} + + + +// operator nodes +// Add +export int add(int a=0, int b=0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(300) +]] +{ return a+b; } + +export float add(float a=0.0, float b=0.0) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(301) +]] +{ return a+b; } + +export float2 add(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(302) +]] +{ return a+b; } + +export float3 add(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(303) +]] +{ return a+b; } + +export float4 add(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(304) +]] +{ return a+b; } + +export color add(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Add"), + anno::description("Adds the two inputs and returns the result. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Add"), + icon(".icons/Add.svg"), + anno::ui_order(305) +]] +{ return a+b; } + +export int subtract(int a=0, int b=0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(310) +]] +{ return a-b; } + +export float subtract(float a=0.0, float b=0.0) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(311) +]] +{ return a-b; } + +export float2 subtract(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(312) +]] +{ return a-b; } + +export float3 subtract(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(313) +]] +{ return a-b; } + +export float4 subtract(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(314) +]] +{ return a-b; } + +export color subtract(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Subtract"), + anno::description("Subtracts the second input from the first. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Subtract"), + icon(".icons/Subtract.svg"), + anno::ui_order(315) +]] +{ return a-b; } + +export int multiply(int a=0, int b=0) +[[ + anno::display_name("Multiply"), + anno::description("Subtracts the second input from the first."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(320) +]] +{ return a*b; } + +export float multiply(float a=0.0, float b=0.0) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(321) +]] +{ return a*b; } + +export float2 multiply(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(322) +]] +{ return a*b; } + +export float3 multiply(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(323) +]] +{ return a*b; } + +export float4 multiply(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(324) +]] +{ return a*b; } + +export color multiply(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Multiply"), + anno::description("Multiplies the two inputs and returns the product. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Multiply"), + icon(".icons/Multiply.svg"), + anno::ui_order(325) +]] +{ return a*b; } + +export int divide(int a=0, int b=0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(326) +]] +{ return a/b; } + +export float divide(float a=0.0, float b=0.0) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(327) +]] +{ return a/b; } + +export float2 divide(float2 a=float2(0.0), float2 b=float2(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(328) +]] +{ return a/b; } + +export float3 divide(float3 a=float3(0.0), float3 b=float3(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(329) +]] +{ return a/b; } + +export float4 divide(float4 a=float4(0.0), float4 b=float4(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(330) +]] +{ return a/b; } + +export color divide(color a=color(0.0), color b=color(0.0)) +[[ + anno::display_name("Divide"), + anno::description("Divides the first input by the second. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Divide"), + icon(".icons/Divide.svg"), + anno::ui_order(331) +]] +{ return a/b; } + +export int condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + int a=0 [[ + anno::description("Value returned when the condition is true.") + ]], + int b=0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(332) +]] +{ return x?a:b; } + +export float condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float a=0.0 [[ + anno::description("Value returned when the condition is true.") + ]], + float b=0.0 [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(333) +]] +{ return x?a:b; } + +export float2 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float2 a=float2(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float2 b=float2(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(334) +]] +{ return x?a:b; } + +export float3 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float3 a=float3(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float3 b=float3(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(335) +]] +{ return x?a:b; } + +export float4 condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + float4 a=float4(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + float4 b=float4(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(336) +]] +{ return x?a:b; } + +export color condition( + uniform bool x=true [[ + anno::description("Condition that selects which input to return.") + ]], + color a=color(0.0) [[ + anno::description("Value returned when the condition is true.") + ]], + color b=color(0.0) [[ + anno::description("Value returned when the condition is false.") + ]] +) +[[ + anno::display_name("Condition?"), + anno::description("Returns input a when the condition is true; otherwise returns input b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Condition"), + icon(".icons/condition.svg"), + anno::ui_order(337) +]] +{ return x?a:b; } + +export bool compare(float a, float b) +[[ + anno::display_name("Compare"), + anno::description("Returns true when a is greater than b; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Comparison"), + icon(".icons/compare.svg"), + anno::ui_order(338) +]] +{ return a>b; } + +export bool equality(bool a, bool b) +[[ + anno::display_name("Check equality bool"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(339) +]] +{ return a==b; } + +export bool equality(int a, int b) +[[ + anno::display_name("Check equality int"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(340) +]] +{ return a==b; } + +export bool equality(int2 a, int2 b) +[[ + anno::display_name("Check equality int2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(341) +]] +{ return a==b; } + +export bool equality(int3 a, int3 b) +[[ + anno::display_name("Check equality int3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(342) +]] +{ return a==b; } + +export bool equality(float a, float b) +[[ + anno::display_name("Check equality float"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(343) +]] +{ return a==b; } + +export bool equality(float2 a, float2 b) +[[ + anno::display_name("Check equality float2"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(344) +]] +{ return a==b; } + +export bool equality(float3 a, float3 b) +[[ + anno::display_name("Check equality float3"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(345) +]] +{ return a==b; } + +export bool equality(color a, color b) +[[ + anno::display_name("Check equality color"), + anno::description("Returns true when both inputs are equal; otherwise returns false."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Operators", "Equality"), + icon(".icons/Equality.svg"), + anno::ui_order(346) +]] +{ return a==b; } + +//constants nodes. +export bool bool_const(uniform bool b = true) +[[ + anno::display_name("Constant bool"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1000) +]] +{ return b; } + +export int int_const(uniform int i = 0) +[[ + anno::display_name("Constant int"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1001) +]] +{ return i; } + +export float float_const(uniform float f = 0.) +[[ + anno::display_name("Constant float"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1002) +]] +{ return f; } + +export float2 float2_const(uniform float2 f2 = float2(0.)) +[[ + anno::display_name("Constant float2"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1003) +]] +{ return f2; } + +export float3 float3_const(uniform float3 f3 = float3(0.)) +[[ + anno::display_name("Constant float3"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1004) +]] +{ return f3; } + +export float4 float4_const(uniform float4 f4 = float4(0.)) +[[ + anno::display_name("Constant float4"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1005) +]] +{ return f4; } + +export color color_const(uniform color c = color(0.)) +[[ + anno::display_name("Constant color"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1006) +]] +{ return c; } + +export uniform texture_2d texture_2d_const(uniform texture_2d tex = texture_2d())[[ + anno::display_name("Constant texture_2d"), + anno::description("Pass-through constant node that returns the provided value unchanged."), + anno::author("NVIDIA Corporation"), + anno::in_group("Constants"), + icon(".icons/constructor.svg"), + anno::ui_order(1007) +]] +{ return tex; } + +//exports from tex: +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose width is queried.") + ]]) uniform +[[ + anno::display_name("Width of texture"), + anno::description("Returns the width of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(141) +]] +{ return tex::width(tex); } + +export int texture_width( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile width is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Width of a texture tile"), + anno::description("Returns the width of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Width"), + icon(".icons/texture_width.svg"), + anno::ui_order(143) +]] +{ return tex::width(tex, uv_tile); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose height is queried.") + ]]) uniform +[[ + anno::display_name("Height of texture"), + anno::description("Returns the height of the input texture in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(142) +]] +{ return tex::height(tex); } + +export int height( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource whose tile height is queried.") + ]], + int2 uv_tile = int2(0, 0) [[ + anno::description("UDIM tile index as (u, v).") + ]]) uniform +[[ + anno::display_name("Height of a texture tile"), + anno::description("Returns the height of the specified texture tile in pixels."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info", "Height"), + icon(".icons/texture_height.svg"), + anno::ui_order(144) +]] +{ return tex::height(tex,uv_tile); } + +export float2 transform_st( + float rotation = 0.0 [[ + anno::description("Rotation angle in radians.") + ]], + float2 translation = float2(0.0) [[ + anno::description("Translation offset applied after rotation and scaling.") + ]], + float2 scale = float2(1.0) [[ + anno::description("Scale factor applied per coordinate axis.") + ]], + float2 st = float2(0.0) [[ + anno::description("Input 2D coordinate to transform.") + ]] +) +[[ + anno::display_name("Transform 2D"), + anno::description("Applies rotation, scaling, and translation to a 2D coordinate."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform"), + icon(".icons/transform.svg"), + anno::ui_order(1019) +]] +{ + float s = math::sin(rotation); + float c = math::cos(rotation); + float2 st_t=st; + st_t = float2(s*st_t.x+c*st_t.y,s*st_t.y-c*st_t.x); + return st_t*scale+ translation; +} + +export color biased_color_blend( + float w1 = 0.0 [[ + anno::description("Weight for the first input color.") + ]], + color c1 = color(0.0) [[ + anno::description("First input color.") + ]], + float w2 = 0.0 [[ + anno::description("Weight for the second input color.") + ]], + color c2 = color(0.0) [[ + anno::description("Second input color.") + ]], + float w3 = 0.0 [[ + anno::description("Weight for the third input color.") + ]], + color c3 = color(0.0) [[ + anno::description("Third input color.") + ]], + color mean = color(0.5) [[ + anno::description("Expected average color used to preserve contrast in the biased blend.") + ]] +) +[[ + anno::display_name("Biased color blend"), + anno::description("Blends up to three colors using weights; set mean to the expected average to preserve contrast when mixing textures."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Blend"), + icon(".icons/biased_color_blend.svg"), + anno::ui_order(539) +]] +{ + color o=w1*c1+w2*c2+w3*c3; + float s=w1+w2+w3; + float s2=w1*w1+w2*w2+w3*w3; +return mean + (o-s*mean)/ math::sqrt(s2); +} + + +export float lookup_float( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(100) +]] +{ return tex::lookup_float( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + +export float3 lookup_float3( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float3"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(110) +]] +{ return tex::lookup_float3( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export float4 lookup_float4( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup float4"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(120) +]] { return tex::lookup_float4( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +export color lookup_color( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to sample.") + ]], + float2 coord = float2(0.) [[ + anno::description("Texture coordinate used for sampling.") + ]], + uniform wrap_mode wrap_u = wrap_repeat [[ + anno::description("Wrap mode applied along the U axis.") + ]], + uniform wrap_mode wrap_v = wrap_repeat [[ + anno::description("Wrap mode applied along the V axis.") + ]], + uniform float2 crop_u = float2(0.0, 1.0) [[ + anno::description("Crop interval along the U axis, expressed as [min, max].") + ]], + uniform float2 crop_v = float2(0.0, 1.0) [[ + anno::description("Crop interval along the V axis, expressed as [min, max].") + ]], + float frame = 0.0 [[ + anno::description("Frame value used for animated textures.") + ]]) uniform +[[ + anno::display_name("Texture lookup color"), + anno::description("Samples a value from a 2D texture using the provided coordinate, wrap, crop, and frame settings."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Lookup"), + icon(".icons/texture_lookup.svg"), + anno::ui_order(130) +]] { return tex::lookup_color( tex, coord, wrap_u, wrap_v, crop_u, crop_v, frame); } + + +// check for valid resource +export bool texture_isvalid( + uniform texture_2d tex = texture_2d() [[ + anno::description("Texture resource to validate.") + ]]) uniform +[[ + anno::display_name("Is texture valid?"), + anno::description("Returns true when the provided texture handle is valid and can be sampled."), + anno::author("NVIDIA Corporation"), + anno::in_group("Texturing", "Info"), + icon(".icons/texture_isvalid.svg"), + anno::ui_order(140) +]] +{ return tex::texture_isvalid(tex); } + + +//exports from state: +export float3 position() +[[ + anno::display_name("Hit position"), + anno::description("Returns the current shading position in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/position.svg"), + anno::ui_order(1012) +]] +{ return state::position(); } + +export float3 normal() +[[ + anno::display_name("Shade normal"), + anno::description("Returns the current shading normal in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/normal.svg"), + anno::ui_order(1013) +]] +{ return state::normal(); } + +//new: quick access to xy: +export float2 texture_coordinate_2d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 2D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1010) +]] +{ return xy(state::texture_coordinate(i)); } + +export float3 texture_coordinate_3d( + uniform int i = 0 [[ + anno::description("Texture coordinate set index.") + ]]) +[[ + anno::display_name("Texture coordinate 3D"), + anno::description("Returns authored texture coordinates from the selected texture coordinate set."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Coordinate"), + icon(".icons/texture_coordinate.svg"), + anno::ui_order(1011) +]] +{ return state::texture_coordinate(i); } + +export float3 texture_tangent_u( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the U tangent.") + ]]) +[[ + anno::display_name("Shade tangent"), + anno::description("Returns the current shading tangent (U direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1014) +]] +{ return state::texture_tangent_u(i); } + +export float3 texture_tangent_v( + uniform int i = 0 [[ + anno::description("Texture coordinate set index used to derive the V tangent.") + ]]) +[[ + anno::display_name("Shade bi-tangent"), + anno::description("Returns the current shading bitangent (V direction) in the renderer's internal coordinate space."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars", "Texture", "Tangent"), + icon(".icons/texture_tangent.svg"), + anno::ui_order(1015) +]] +{ return state::texture_tangent_v(i); } + +export float animation_time() +[[ + anno::display_name("Animation time"), + anno::description("Returns elapsed animation time in seconds from the start of the timeline."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene"), + icon(".icons/animation_time.svg"), + anno::ui_order(1030) +]] +{ return state::animation_time(); } + + +export float3 transform_point( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input point.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed point.") + ]], + float3 point=float3(0.) [[ + anno::description("Point to transform.") + ]]) +[[ + anno::display_name("Transform point"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1020) +]] +{ return state::transform_point(from, to, point); } + +export float3 transform_vector( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input vector.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed vector.") + ]], + float3 vector=float3(0.) [[ + anno::description("Vector to transform.") + ]]) +[[ + anno::display_name("Transform vector"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1021) +]] +{ return state::transform_vector(from, to, vector); } + +export float3 transform_normal( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input normal.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed normal.") + ]], + float3 normal=float3(0.,1.,0.) [[ + anno::description("Normal vector to transform.") + ]]) +[[ + anno::display_name("Transform normal"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1022) +]] +{ return state::transform_normal(from, to, normal); } + +export float transform_scale( + uniform coordinate_space from=coordinate_internal [[ + anno::description("Source coordinate space of the input scale value.") + ]], + uniform coordinate_space to=coordinate_object [[ + anno::description("Destination coordinate space for the transformed scale value.") + ]], + float scale=0. [[ + anno::description("Scale value to transform.") + ]]) +[[ + anno::display_name("Transform scale"), + anno::description("Transforms the input value between internal, object, and world coordinate spaces."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Coordinate"), + icon(".icons/transform.svg"), + anno::ui_order(1023) +]] +{ return state::transform_scale(from, to, scale); } + +float2 r2d(float2 x, float theta) +{ + theta *= math::acos(-1.0) * 2.0; + return float2( + math::cos(theta) * x[0] + math::sin(theta) * x[1], + math::cos(theta) * x[1] - math::sin(theta) * x[0]); +} + +export float3 rotate_around_x( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around X"), + anno::description("Rotates a 3D point around the X axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1024) +]] +{ + float2 v = r2d(float2(p.y, p.z), theta); + return float3(p.x, v[0], v[1]); +} + +export float3 rotate_around_y( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Y"), + anno::description("Rotates a 3D point around the Y axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1025) +]] +{ + float2 v = r2d(float2(p.x, p.z), theta); + return float3(v[0], p.y, v[1]); +} + +export float3 rotate_around_z( + float3 p [[ + anno::description("Point to rotate.") + ]], + float theta [[ + anno::description("Rotation amount in turns, where 1.0 is a full 360-degree rotation.") + ]]) +[[ + anno::display_name("Rotate Around Z"), + anno::description("Rotates a 3D point around the Z axis by the input angle."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Transform", "Rotation"), + icon(".icons/rotation.svg"), + anno::ui_order(1026) +]] +{ + float2 v = r2d(float2(p.x, p.y), theta); + return float3(v[0], v[1], p.z); +} + +export float meters_per_scene_unit() +[[ + anno::display_name("Meters per scene unit"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/meters_per_scene_unit.svg"), + anno::ui_order(1031) +]] +{ return state::meters_per_scene_unit(); } + +export float scene_units_per_meter() +[[ + anno::display_name("Scene units per meter"), + anno::description("Returns the conversion factor between scene units and meters."), + anno::author("NVIDIA Corporation"), + anno::in_group("Scene", "Units"), + icon(".icons/scene_units_per_meter.svg"), + anno::ui_order(1032) +]] +{ return state::scene_units_per_meter(); } + +export int object_id() +[[ + anno::display_name("Object Id"), + anno::description("Returns the unique integer identifier of the currently shaded object."), + anno::author("NVIDIA Corporation"), + anno::in_group("State and Primvars"), + icon(".icons/object_id.svg"), + anno::ui_order(1033) +]] +{ return state::object_id(); } + +//exported from math: +export color blackbody( + float temperature=6500. [[ + anno::description("Blackbody temperature in Kelvin used to compute the emitted color.") + ]]) +[[ + anno::display_name("Blackbody color"), + anno::description("Returns the RGB color of an ideal blackbody radiator at the specified temperature in Kelvin."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/blackbody.svg"), + anno::ui_order(409) +]] +{ return math::blackbody(temperature); } + +export float PI() +[[ + anno::display_name("Pi"), + anno::description("Returns the mathematical constant pi (approximately 3.141592653589793)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Constants"), + icon(".icons/PI.svg"), + anno::ui_order(1007) +]] +{ return math::PI; } + +export int abs(int a=0) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(350) +]] +{ return math::abs(a); } + +export float abs(float a=0.) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(351) +]] +{ return math::abs(a); } + +export float2 abs(float2 a=float2(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(352) +]] +{ return math::abs(a); } + +export float3 abs(float3 a=float3(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(353) +]] +{ return math::abs(a); } + +export float4 abs(float4 a=float4(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(354) +]] +{ return math::abs(a); } + +export color abs(color a=color(0.)) +[[ + anno::display_name("Abs"), + anno::description("Returns the absolute value of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Abs"), + icon(".icons/Abs.svg"), + anno::ui_order(355) +]] +{ return math::abs(a); } + +export float acos(float a=0.) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(360) +]] +{ return math::acos(a); } + +export float2 acos(float2 a=float2(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(361) +]] +{ return math::acos(a); } + +export float3 acos(float3 a=float3(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(362) +]] +{ return math::acos(a); } + +export float4 acos(float4 a=float4(0.)) +[[ + anno::display_name("Acos"), + anno::description("Returns the inverse cosine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Acos"), + icon(".icons/Acos.svg"), + anno::ui_order(363) +]] +{ return math::acos(a); } + + +export float asin(float a=0.) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(370) +]] +{ return math::asin(a); } + +export float2 asin(float2 a=float2(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(371) +]] +{ return math::asin(a); } + +export float3 asin(float3 a=float3(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(372) +]] +{ return math::asin(a); } + +export float4 asin(float4 a=float4(0.)) +[[ + anno::display_name("Asin"), + anno::description("Returns the inverse sine in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Asin"), + icon(".icons/Asin.svg"), + anno::ui_order(373) +]] +{ return math::asin(a); } + +export float atan(float a=0.) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(380) +]] +{ return math::atan(a); } + +export float2 atan(float2 a=float2(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(381) +]] +{ return math::atan(a); } + +export float3 atan(float3 a=float3(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(382) +]] +{ return math::atan(a); } + +export float4 atan(float4 a=float4(0.)) +[[ + anno::display_name("Atan"), + anno::description("Returns the inverse tangent in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan"), + icon(".icons/Atan.svg"), + anno::ui_order(383) +]] +{ return math::atan(a); } + +export float atan2( + float y=0. [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float x=0. [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(390) +]] +{ return math::atan2(y,x); } + +export float2 atan2( + float2 y=float2(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float2 x=float2(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(391) +]] +{ return math::atan2(y,x); } + +export float3 atan2( + float3 y=float3(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float3 x=float3(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(392) +]] +{ return math::atan2(y,x); } + +export float4 atan2( + float4 y=float4(0.) [[anno::description("Y component (numerator) used by atan2(y, x).")]], + float4 x=float4(0.) [[anno::description("X component (denominator) used by atan2(y, x).")]] +) +[[ + anno::display_name("Atan2"), + anno::description("Returns atan2(y, x) in radians, using both signs to determine the correct quadrant. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Atan2"), + icon(".icons/Atan2.svg"), + anno::ui_order(393) +]] +{ return math::atan2(y,x); } + +export float average(float2 a=float2(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(400) +]] +{ return math::average(a); } + +export float average(float3 a=float3(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(401) +]] +{ return math::average(a); } + +export float average(float4 a=float4(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(402) +]] +{ return math::average(a); } + +export float average(color a=color(0.)) +[[ + anno::display_name("Average"), + anno::description("Returns the arithmetic mean of all components in the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Average"), + icon(".icons/Average.svg"), + anno::ui_order(403) +]] +{ return math::average(a); } + +export float ceil(float a=0.) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(410) +]] +{ return math::ceil(a); } + +export float2 ceil(float2 a=float2(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float3 ceil(float3 a=float3(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(411) +]] +{ return math::ceil(a); } + +export float4 ceil(float4 a=float4(0.)) +[[ + anno::display_name("Ceil"), + anno::description("Rounds each input value up to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Ceil"), + icon(".icons/Ceil.svg"), + anno::ui_order(412) +]] +{ return math::ceil(a); } + +export int clamp( + int a=0 [[anno::description("Input value to clamp.")]], + int min=0 [[anno::description("Lower bound of the output range.")]], + int max=1 [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(420) +]] +{ return math::clamp(a,min,max); } + +export float clamp( + float a=0. [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(421) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(422) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(423) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(424) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(425) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float2 min=float2(0.) [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(426) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float2 max=float2(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(427) +]] +{ return math::clamp(a,min,max); } + +export float2 clamp( + float2 a=float2(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=1. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(428) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float3 min=float3(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(429) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float3 max=float3(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(430) +]] +{ return math::clamp(a,min,max); } + +export float3 clamp( + float3 a=float3(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(431) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float4 min=float4(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(432) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float4 max=float4(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(433) +]] +{ return math::clamp(a,min,max); } + +export float4 clamp( + float4 a=float4(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(434) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + color min=color(0.) [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(435) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + color max=color(1.) [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(436) +]] +{ return math::clamp(a,min,max); } + +export color clamp( + color a=color(0.) [[anno::description("Input value to clamp.")]], + float min=0. [[anno::description("Lower bound of the output range.")]], + float max=0. [[anno::description("Upper bound of the output range.")]] +) +[[ + anno::display_name("Clamp"), + anno::description("Clamps the input to the inclusive [min, max] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Clamp"), + icon(".icons/Clamp.svg"), + anno::ui_order(437) +]] +{ return math::clamp(a,min,max); } + +export float cos(float a=0.) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(440) +]] +{ return math::cos(a); } + +export float2 cos(float2 a=float2(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(441) +]] +{ return math::cos(a); } + +export float3 cos(float3 a=float3(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(442) +]] +{ return math::cos(a); } + +export float4 cos(float4 a=float4(0.)) +[[ + anno::display_name("Cos"), + anno::description("Returns the cosine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Cos"), + icon(".icons/Cos.svg"), + anno::ui_order(443) +]] +{ return math::cos(a); } + +export float3 cross(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Cross"), + anno::description("Returns the 3D cross product of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/cross_product.svg"), + anno::ui_order(449) +]] +{ return math::cross(a,b); } + +export float degrees( + float a=0. [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(450) +]] +{ return math::degrees(a); } + +export float2 degrees( + float2 a=float2(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(451) +]] +{ return math::degrees(a); } + +export float3 degrees( + float3 a=float3(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(452) +]] +{ return math::degrees(a); } + +export float4 degrees( + float4 a=float4(0.) [[anno::description("Input angle in radians.")]] +) +[[ + anno::display_name("Degrees"), + anno::description("Converts an angle from radians to degrees. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Degrees"), + icon(".icons/Degrees.svg"), + anno::ui_order(453) +]] +{ return math::degrees(a); } + +export float distance(float a=0., float b=0.) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(460) +]] +{ return math::distance(a,b); } + +export float distance(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(461) +]] +{ return math::distance(a,b); } + +export float distance(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(462) +]] +{ return math::distance(a,b); } + +export float distance(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Distance"), + anno::description("Returns the Euclidean distance between the two input points."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Distance"), + icon(".icons/Distance.svg"), + anno::ui_order(463) +]] +{ return math::distance(a,b); } + +export float dot(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(470) +]] +{ return math::dot(a,b); } + +export float dot(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(471) +]] +{ return math::dot(a,b); } + +export float dot(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Dot"), + anno::description("Returns the dot product (scalar projection) of the two input vectors."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Dot"), + icon(".icons/Dot.svg"), + anno::ui_order(472) +]] +{ return math::dot(a,b); } + +export float exp(float a=0.) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(480) +]] +{ return math::exp(a); } + +export float2 exp(float2 a=float2(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float3 exp(float3 a=float3(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(481) +]] +{ return math::exp(a); } + +export float4 exp(float4 a=float4(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(482) +]] +{ return math::exp(a); } + +export color exp(color a=color(0.)) +[[ + anno::display_name("Exp"), + anno::description("Returns e raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp"), + icon(".icons/Exp.svg"), + anno::ui_order(483) +]] +{ return math::exp(a); } + +export float exp2(float a=0.) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(490) +]] +{ return math::exp2(a); } + +export float2 exp2(float2 a=float2(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(491) +]] +{ return math::exp2(a); } + +export float3 exp2(float3 a=float3(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(492) +]] +{ return math::exp2(a); } + +export float4 exp2(float4 a=float4(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(493) +]] +{ return math::exp2(a); } + +export color exp2(color a=color(0.)) +[[ + anno::display_name("Exp 2"), + anno::description("Returns 2 raised to the input value. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Exp2"), + icon(".icons/Exp2.svg"), + anno::ui_order(494) +]] +{ return math::exp2(a); } + +export float floor(float a=0.) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(500) +]] +{ return math::floor(a); } + +export float2 floor(float2 a=float2(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(501) +]] +{ return math::floor(a); } + +export float3 floor(float3 a=float3(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(502) +]] +{ return math::floor(a); } + +export float4 floor(float4 a=float4(0.)) +[[ + anno::display_name("Floor"), + anno::description("Rounds each input value down to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Floor"), + icon(".icons/Floor.svg"), + anno::ui_order(503) +]] +{ return math::floor(a); } + +export float fmod( + float a=0. [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(510) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float2 b=float2(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(511) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float3 b=float3(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(512) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float4 b=float4(1.) [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(513) +]] +{ return math::fmod(a,b); } + +export float2 fmod( + float2 a=float2(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(514) +]] +{ return math::fmod(a,b); } + +export float3 fmod( + float3 a=float3(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(515) +]] +{ return math::fmod(a,b); } + +export float4 fmod( + float4 a=float4(0.) [[anno::description("Dividend input.")]], + float b=1. [[anno::description("Divisor input.")]] +) +[[ + anno::display_name("Fmod"), + anno::description("Returns the floating-point remainder of dividing a by b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Fmod"), + icon(".icons/Fmod.svg"), + anno::ui_order(516) +]] +{ return math::fmod(a,b); } + +export float frac(float a=0.) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(520) +]] +{ return math::frac(a); } + +export float2 frac(float2 a=float2(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(521) +]] +{ return math::frac(a); } + +export float3 frac(float3 a=float3(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(522) +]] +{ return math::frac(a); } + +export float4 frac(float4 a=float4(0.)) +[[ + anno::display_name("Frac"), + anno::description("Returns the positive fractional part of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Frac"), + icon(".icons/Frac.svg"), + anno::ui_order(523) +]] +{ return math::frac(a); } + +export float length(float2 a=float2(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(530) +]] +{ return math::length(a); } + +export float length(float3 a=float3(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(531) +]] +{ return math::length(a); } + +export float length(float4 a=float4(0.)) +[[ + anno::display_name("Length"), + anno::description("Returns the Euclidean length (magnitude) of the input vector."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Length"), + icon(".icons/Length.svg"), + anno::ui_order(532) +]] +{ return math::length(a); } + +export float lerp( + float a=0. [[anno::description("Start value at interpolation factor 0.")]], + float b=1. [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(540) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float2 l=float2(0.)[[anno::soft_range(float2(0.0),float2(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(541) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float3 l=float3(0.)[[anno::soft_range(float3(0.0),float3(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(542) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float4 l=float4(0.)[[anno::soft_range(float4(0.0),float4(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(543) +]] +{ return math::lerp(a,b,l); } + +export float2 lerp( + float2 a=float2(0.) [[anno::description("Start value at interpolation factor 0.")]], + float2 b=float2(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(544) +]] +{ return math::lerp(a,b,l); } + +export float3 lerp( + float3 a=float3(0.) [[anno::description("Start value at interpolation factor 0.")]], + float3 b=float3(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(545) +]] +{ return math::lerp(a,b,l); } + +export float4 lerp( + float4 a=float4(0.) [[anno::description("Start value at interpolation factor 0.")]], + float4 b=float4(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(546) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + color l=color(0.)[[anno::soft_range(color(0.0),color(1.)), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(547) +]] +{ return math::lerp(a,b,l); } + +export color lerp( + color a=color(0.) [[anno::description("Start value at interpolation factor 0.")]], + color b=color(1.) [[anno::description("End value at interpolation factor 1.")]], + float l=0.[[anno::soft_range(0.0,1.), anno::description("Interpolation factor between a and b.")]] +) +[[ + anno::display_name("Lerp"), + anno::description("Linearly interpolates between a and b using interpolation factor l."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Lerp"), + icon(".icons/Lerp.svg"), + anno::ui_order(548) +]] +{ return math::lerp(a,b,l); } + +export float log(float a=1.) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(550) +]] +{ return math::log(a); } + +export float2 log(float2 a=float2(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(551) +]] +{ return math::log(a); } + +export float3 log(float3 a=float3(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(552) +]] +{ return math::log(a); } + +export float4 log(float4 a=float4(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(553) +]] +{ return math::log(a); } + +export color log(color a=color(1.)) +[[ + anno::display_name("Log"), + anno::description("Computes the natural logarithm (base e) of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log"), + icon(".icons/Log.svg"), + anno::ui_order(554) +]] +{ return math::log(a); } + +export float log2(float a=1.) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(560) +]] +{ return math::log2(a); } + +export float2 log2(float2 a=float2(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(561) +]] +{ return math::log2(a); } + +export float3 log2(float3 a=float3(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(562) +]] +{ return math::log2(a); } + +export float4 log2(float4 a=float4(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(563) +]] +{ return math::log2(a); } + +export color log2(color a=color(1.)) +[[ + anno::display_name("Log 2"), + anno::description("Computes the base-2 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log2"), + icon(".icons/Log2.svg"), + anno::ui_order(564) +]] +{ return math::log2(a); } + +export float log10(float a=1.) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(570) +]] +{ return math::log10(a); } + +export float2 log10(float2 a=float2(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(571) +]] +{ return math::log10(a); } + +export float3 log10(float3 a=float3(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(572) +]] +{ return math::log10(a); } + +export float4 log10(float4 a=float4(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(573) +]] +{ return math::log10(a); } + +export color log10(color a=color(1.)) +[[ + anno::display_name("Log 10"), + anno::description("Computes the base-10 logarithm of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Log10"), + icon(".icons/Log10.svg"), + anno::ui_order(574) +]] +{ return math::log10(a); } + +export float luminance(float3 a=float3(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(580) +]] +{ return math::luminance(a); } + +export float luminance(color a=color(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(581) +]] +{ return math::luminance(a); } + +export float luminance(float4 a=float4(0.)) +[[ + anno::display_name("Luminance"), + anno::description("Computes luminance (Y) from the input color using standard RGB weighting."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Luminance"), + icon(".icons/Luminance.svg"), + anno::ui_order(582) +]] +{ return math::luminance(float3(a.x,a.y,a.z)); } + +export int max(int a=0, int b=0) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(590) +]] +{ return math::max(a,b); } + +export float max(float a=0., float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(591) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(592) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(593) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(594) +]] +{ return math::max(a,b); } + +export float2 max(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(595) +]] +{ return math::max(a,b); } + +export float3 max(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(596) +]] +{ return math::max(a,b); } + +export float4 max(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(597) +]] +{ return math::max(a,b); } + +export float2 max(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(598) +]] +{ return math::max(a,b); } + +export float3 max(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(599) +]] +{ return math::max(a,b); } + +export float4 max(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(600) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(601) +]] +{ return math::max(a,b); } + +export color max(float a=0., color b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(602) +]] +{ return math::max(a,b); } + +export color max(color a=color(0.), float b=0.) +[[ + anno::display_name("Maximum"), + anno::description("Returns the larger of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(603) +]] +{ return math::max(a,b); } + +export float max_value(float2 a=float2(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(610) +]] +{ return math::max_value(a); } + +export float max_value(float3 a=float3(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(611) +]] +{ return math::max_value(a); } + +export float max_value(float4 a=float4(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(612) +]] +{ return math::max_value(a); } + +export float max_value(color a=color(0.)) +[[ + anno::display_name("Maximum value"), + anno::description("Returns the largest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Max"), + icon(".icons/Max.svg"), + anno::ui_order(613) +]] +{ return math::max_value(a); } + +export int min(int a=0, int b=0) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(620) +]] +{ return math::min(a,b); } + +export float min(float a=0., float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(621) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(622) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(623) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(624) +]] +{ return math::min(a,b); } + +export float2 min(float2 a=float2(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(625) +]] +{ return math::min(a,b); } + +export float3 min(float3 a=float3(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(626) +]] +{ return math::min(a,b); } + +export float4 min(float4 a=float4(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(627) +]] +{ return math::min(a,b); } + +export float2 min(float a=0., float2 b=float2(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(628) +]] +{ return math::min(a,b); } + +export float3 min(float a=0., float3 b=float3(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(629) +]] +{ return math::min(a,b); } + +export float4 min(float a=0., float4 b=float4(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(630) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(631) +]] +{ return math::min(a,b); } + +export color min(float a=0., color b=color(0.)) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(632) +]] +{ return math::min(a,b); } + +export color min(color a=color(0.), float b=0.) +[[ + anno::display_name("Minimum"), + anno::description("Returns the smaller of the two inputs. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(633) +]] +{ return math::min(a,b); } + +export float min_value(float a=0.) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(640) +]] +{ return math::min_value(a); } + +export float min_value(float2 a=float2(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(641) +]] +{ return math::min_value(a); } + +export float min_value(float3 a=float3(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(642) +]] +{ return math::min_value(a); } + +export float min_value(float4 a=float4(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest component value in the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(643) +]] +{ return math::min_value(a); } + +export float min_value(color a=color(0.)) +[[ + anno::display_name("Minimum value"), + anno::description("Returns the smallest channel value in the input color."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Min"), + icon(".icons/Min.svg"), + anno::ui_order(644) +]] +{ return math::min_value(a); } + +export float2 normalize( + float2 a=float2(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(650) +]] +{ return math::normalize(a); } + +export float3 normalize( + float3 a=float3(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(651) +]] +{ return math::normalize(a); } + +export float4 normalize( + float4 a=float4(0.) [[anno::description("Input vector to normalize.")]] +) +[[ + anno::display_name("Normalize"), + anno::description("Normalizes the input vector to unit length (length 1)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Normalize"), + icon(".icons/Normalize.svg"), + anno::ui_order(652) +]] +{ return math::normalize(a); } + +export int pow( + int a=0 [[anno::description("Base value.")]], + int b=0 [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(660) +]] +{ return math::pow(a,b); } + +export float pow( + float a=0. [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(661) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float2 b=float2(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(662) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float3 b=float3(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(663) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float4 b=float4(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(664) +]] +{ return math::pow(a,b); } + +export float2 pow( + float2 a=float2(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(665) +]] +{ return math::pow(a,b); } + +export float3 pow( + float3 a=float3(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(666) +]] +{ return math::pow(a,b); } + +export float4 pow( + float4 a=float4(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(667) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + color b=color(0.) [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(668) +]] +{ return math::pow(a,b); } + +export color pow( + color a=color(0.) [[anno::description("Base value.")]], + float b=0. [[anno::description("Exponent value.")]] +) +[[ + anno::display_name("Pow"), + anno::description("Raises a to the power b. Parameter a must not be negative. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Pow"), + icon(".icons/Pow.svg"), + anno::ui_order(669) +]] +{ return math::pow(a,b); } + +export float radians( + float a=0. [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(670) +]] +{ return math::radians(a); } + +export float2 radians( + float2 a=float2(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(671) +]] +{ return math::radians(a); } + +export float3 radians( + float3 a=float3(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(672) +]] +{ return math::radians(a); } + +export float4 radians( + float4 a=float4(0.) [[anno::description("Input angle in degrees.")]] +) +[[ + anno::display_name("Radians"), + anno::description("Converts an angle from degrees to radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Radians"), + icon(".icons/Radians.svg"), + anno::ui_order(673) +]] +{ return math::radians(a); } + +export float round(float a=0.) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(690) +]] +{ return math::round(a); } + +export float2 round(float2 a=float2(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(691) +]] +{ return math::round(a); } + +export float3 round(float3 a=float3(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(692) +]] +{ return math::round(a); } + +export float4 round(float4 a=float4(0.)) +[[ + anno::display_name("Round"), + anno::description("Rounds to the nearest integer. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Round"), + icon(".icons/Round.svg"), + anno::ui_order(693) +]] +{ return math::round(a); } + +export float rsqrt(float a=0.) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(700) +]] +{ return math::rsqrt(a); } + +export float2 rsqrt(float2 a=float2(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(701) +]] +{ return math::rsqrt(a); } + +export float3 rsqrt(float3 a=float3(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(702) +]] +{ return math::rsqrt(a); } + +export float4 rsqrt(float4 a=float4(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(703) +]] +{ return math::rsqrt(a); } + +export color rsqrt(color a=color(0.)) +[[ + anno::display_name("Rsqrt"), + anno::description("Returns 1/sqrt(a). The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Rsqrt"), + icon(".icons/Rsqrt.svg"), + anno::ui_order(704) +]] +{ return math::rsqrt(a); } + +export float saturate( + float a=0. [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(710) +]] +{ return math::saturate(a); } + +export float2 saturate( + float2 a=float2(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(711) +]] +{ return math::saturate(a); } + +export float3 saturate( + float3 a=float3(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(712) +]] +{ return math::saturate(a); } + +export float4 saturate( + float4 a=float4(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(713) +]] +{ return math::saturate(a); } + +export color saturate( + color a=color(0.) [[anno::description("Input value to clamp to the [0, 1] range.")]] +) +[[ + anno::display_name("Saturate"), + anno::description("Clamps the input to the [0, 1] range. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Saturate"), + icon(".icons/Saturate.svg"), + anno::ui_order(714) +]] +{ return math::saturate(a); } + +export int sign(int a=0) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(720) +]] +{ return math::sign(a); } + +export float sign(float a=0.) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(721) +]] +{ return math::sign(a); } + +export float2 sign(float2 a=float2(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(722) +]] +{ return math::sign(a); } + +export float3 sign(float3 a=float3(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(723) +]] +{ return math::sign(a); } + +export float4 sign(float4 a=float4(0.)) +[[ + anno::display_name("Sign"), + anno::description("Returns the sign of the input: 1 for positive, -1 for negative, and 0 for zero. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sign"), + icon(".icons/Sign.svg"), + anno::ui_order(724) +]] +{ return math::sign(a); } + +export float sin(float a=0.) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(730) +]] +{ return math::sin(a); } + +export float2 sin(float2 a=float2(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(731) +]] +{ return math::sin(a); } + +export float3 sin(float3 a=float3(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(732) +]] +{ return math::sin(a); } + +export float4 sin(float4 a=float4(0.)) +[[ + anno::display_name("Sin"), + anno::description("Returns the sine of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sin"), + icon(".icons/Sin.svg"), + anno::ui_order(733) +]] +{ return math::sin(a); } + +export float2 sincos( + float a=0. [[ + anno::description("Input angle in radians.") + ]]) +[[ + anno::display_name("SinCos"), + anno::description("Computes sine and cosine for the same input angle and returns float2(sin, cos)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions"), + icon(".icons/sincos.svg"), + anno::ui_order(739) +]] +{ float[]b = math::sincos(a); return float2(b[0],b[1]); } + +export float smoothstep( + float a=0. [[ + anno::description("Lower edge of the interpolation range.") + ]], + float b=1. [[ + anno::description("Upper edge of the interpolation range.") + ]], + float l=0. [[ + anno::description("Input value to evaluate against the interpolation range.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(740) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float2 l=float2(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(741) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float3 l=float3(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(742) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float4 l=float4(0.) [[ + anno::description("Input value evaluated per component.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(743) +]] +{ return math::smoothstep(a,b,l); } + +export float2 smoothstep( + float2 a=float2(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(744) +]] +{ return math::smoothstep(a,b,l); } + +export float3 smoothstep( + float3 a=float3(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(745) +]] +{ return math::smoothstep(a,b,l); } + +export float4 smoothstep( + float4 a=float4(1.) [[ + anno::description("Lower interpolation edge per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Upper interpolation edge per component.") + ]], + float l=0. [[ + anno::description("Scalar input value applied to all components.") + ]]) +[[ + anno::display_name("Smoothstep"), + anno::description("Performs smooth Hermite interpolation from 0 to 1 as l moves from a to b. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Smoothstep"), + icon(".icons/Smoothstep.svg"), + anno::ui_order(746) +]] +{ return math::smoothstep(a,b,l); } + +export float sqrt(float a=0.) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(750) +]] +{ return math::sqrt(a); } + +export float2 sqrt(float2 a=float2(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(751) +]] +{ return math::sqrt(a); } + +export float3 sqrt(float3 a=float3(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(752) +]] +{ return math::sqrt(a); } + +export float4 sqrt(float4 a=float4(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(753) +]] +{ return math::sqrt(a); } + +export color sqrt(color a=color(0.)) +[[ + anno::display_name("Sqrt"), + anno::description("Returns the square root of the input. The operation is performed per color channel."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Sqrt"), + icon(".icons/Sqrt.svg"), + anno::ui_order(754) +]] +{ return math::sqrt(a); } + +export float step( + float a=0. [[ + anno::description("Threshold value.") + ]], + float b=0. [[ + anno::description("Input compared against the threshold.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(760) +]] +{ return math::step(a,b); } + +export float2 step( + float2 a=float2(0.) [[ + anno::description("Threshold value per component.") + ]], + float2 b=float2(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(761) +]] +{ return math::step(a,b); } + +export float3 step( + float3 a=float3(0.) [[ + anno::description("Threshold value per component.") + ]], + float3 b=float3(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(762) +]] +{ return math::step(a,b); } + +export float4 step( + float4 a=float4(0.) [[ + anno::description("Threshold value per component.") + ]], + float4 b=float4(0.) [[ + anno::description("Input compared against the threshold per component.") + ]]) +[[ + anno::display_name("Step"), + anno::description("Returns 0 when b is less than a, and 1 otherwise. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Step"), + icon(".icons/Step.svg"), + anno::ui_order(763) +]] +{ return math::step(a,b); } + +export float tan(float a=0.) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(770) +]] +{ return math::tan(a); } + +export float2 tan(float2 a=float2(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(771) +]] +{ return math::tan(a); } + +export float3 tan(float3 a=float3(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(772) +]] +{ return math::tan(a); } + +export float4 tan(float4 a=float4(0.)) +[[ + anno::display_name("Tan"), + anno::description("Returns the tangent of the input angle in radians. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Tan"), + icon(".icons/Tan.svg"), + anno::ui_order(773) +]] +{ return math::tan(a); } + +export float remap( + float a=0. [[ + anno::description("Input value in the source range.") + ]], + float start_old=0. [[ + anno::description("Lower bound of the source range.") + ]], + float end_old=1. [[ + anno::description("Upper bound of the source range.") + ]], + float start_new=0. [[ + anno::description("Lower bound of the destination range.") + ]], + float end_new=1. [[ + anno::description("Upper bound of the destination range.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(680) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float2 remap( + float2 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float2 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float2 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float2 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float2 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x and y)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(681) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float3 remap( + float3 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float3 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float3 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float3 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float3 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, and z)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(682) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } + +export float4 remap( + float4 a=0. [[ + anno::description("Input value in the source range, evaluated per component.") + ]], + float4 start_old=0. [[ + anno::description("Lower bound of the source range per component.") + ]], + float4 end_old=1. [[ + anno::description("Upper bound of the source range per component.") + ]], + float4 start_new=0. [[ + anno::description("Lower bound of the destination range per component.") + ]], + float4 end_new=1. [[ + anno::description("Upper bound of the destination range per component.") + ]]) +[[ + anno::display_name("Remap"), + anno::description("Remaps the input from [start_old, end_old] into [start_new, end_new]. The operation is performed per component (x, y, z, and w)."), + anno::author("NVIDIA Corporation"), + anno::in_group("Math", "Functions", "Remap"), + icon(".icons/Remap.svg"), + anno::ui_order(683) +]] +{ return start_new + (a - start_old) * (end_new - start_new) / (end_old - start_old); } diff --git a/unitree_z1/payloads/Physics/mujoco.usda b/unitree_z1/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..f982596575db1ba42e42acb1364183b6064b1f3a --- /dev/null +++ b/unitree_z1/payloads/Physics/mujoco.usda @@ -0,0 +1,197 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "z1_description" +{ + over "root_joint" + { + } + + over "link00" + { + over "joint1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + + over "collisions" + { + over "mesh_0" + { + } + } + } + + over "link01" + { + over "joint2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + } + + over "link02" + { + over "joint3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + + over "collisions" + { + over "mesh_0" + { + } + + over "mesh_1" + { + } + + over "mesh_2" + { + } + } + } + + over "link03" + { + over "joint4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + + over "collisions" + { + over "mesh_0" + { + } + + over "mesh_1" + { + } + } + } + + over "link04" + { + over "joint5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + + over "collisions" + { + } + } + + over "link05" + { + over "joint6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + } + + over "link06" + { + over "visuals" + { + over "mesh_0" + { + } + + over "Looks" + { + } + } + + over "collisions" + { + over "mesh_0" + { + } + } + } + + over "VisualMaterials" + { + } +} + diff --git a/unitree_z1/payloads/Physics/physics.usda b/unitree_z1/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..e3ee72481ec6c6e6b1176a54dd4f2565b55b3d4f --- /dev/null +++ b/unitree_z1/payloads/Physics/physics.usda @@ -0,0 +1,271 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "z1_description" + metersPerUnit = 1 + upAxis = "Z" +) + +over "z1_description" +{ + over "link00" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00334984, -0.00013615, 0.02495843) + float3 physics:diagonalInertia = (0.00037865774, 0.0004152068, 0.0005313755) + float physics:mass = 0.4724748 + quatf physics:principalAxes = (0.9993948, 0.003952194, -0.034064516, 0.005837089) + + def PhysicsRevoluteJoint "joint1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 50 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 500 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0.0585) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.70710677, 0, -0.70710677, 0) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -149.99998 + float physics:upperLimit = 149.99998 + } + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } + + over "link01" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00000247, -0.00025198, 0.02317169) + float3 physics:diagonalInertia = (0.0012832802, 0.0007193078, 0.00083936175) + float physics:mass = 0.67332554 + quatf physics:principalAxes = (0.9999978, -0.0020822193, 0.000450702, -0.000052655443) + + def PhysicsRevoluteJoint "joint2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 50 + float drive:angular:physics:maxForce = 60 + float drive:angular:physics:stiffness = 500 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0, 0, 0.045) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.5213338136672974, 0.4777143895626068, 0.4777143895626068, 0.5213338136672974) + quatf physics:localRot1 = (0.70710677, 0, 0, 0.70710677) + float physics:lowerLimit = -84.99999237060547 + float physics:upperLimit = 84.99999237060547 + } + } + + over "link02" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.11012601, 0.00240029, 0.00158266) + float3 physics:diagonalInertia = (0.0010046825, 0.024311256, 0.024661155) + float physics:mass = 1.1913226 + quatf physics:principalAxes = (0.9999066, 0.002804847, 0.00007204556, -0.013384024) + + def PhysicsRevoluteJoint "joint3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 50 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 500 + float drive:angular:physics:targetPosition = 0 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (-0.35, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.5316310524940491, -0.46622785925865173, -0.46622785925865173, 0.5316310524940491) + quatf physics:localRot1 = (0.70710677, 0, 0, 0.70710677) + float physics:lowerLimit = -82.49999237060547 + float physics:upperLimit = 82.49999237060547 + } + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + + over "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + + over "link03" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.10609208, -0.00541815, 0.03476383) + float3 physics:diagonalInertia = (0.00055843196, 0.0095436545, 0.009387113) + float physics:mass = 0.83940876 + quatf physics:principalAxes = (0.9921452, 0.025269112, -0.12225115, 0.008012127) + + def PhysicsRevoluteJoint "joint4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 50 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 500 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0.218, 0, 0.057) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.70710677, 0, 0, 0.70710677) + quatf physics:localRot1 = (0.70710677, 0, 0, 0.70710677) + float physics:lowerLimit = -86.99999 + float physics:upperLimit = 86.99999 + } + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + + over "link04" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.04366681, 0.00364738, -0.00170192) + float3 physics:diagonalInertia = (0.00030265475, 0.00094052945, 0.0009816558) + float physics:mass = 0.5640456 + quatf physics:principalAxes = (0.9973969, 0.009613185, 0.029951058, -0.06488567) + + def PhysicsRevoluteJoint "joint5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 50 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 500 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0.07, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0.70710677, 0, -0.70710677, 0) + quatf physics:localRot1 = (0.70710677, 0, -0.70710677, 0) + float physics:lowerLimit = -77 + float physics:upperLimit = 77 + } + } + + over "link05" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.03121533, 0, 0.00646316) + float3 physics:diagonalInertia = (0.00016733221, 0.0005589608, 0.00054731703) + float physics:mass = 0.38938493 + quatf physics:principalAxes = (0.997107, -0.0029482334, 0.07595268, -0.0003068974) + + def PhysicsRevoluteJoint "joint6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular"] + ) + { + float drive:angular:physics:damping = 50 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 500 + uniform token drive:angular:physics:type = "force" + uniform token physics:axis = "X" + custom rel physics:body0 = + custom rel physics:body1 = + float physics:breakForce = 3.4028235e38 + float physics:breakTorque = 3.4028235e38 + point3f physics:localPos0 = (0.0492, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -159.99998 + float physics:upperLimit = 159.99998 + } + } + + over "link06" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0241569, -0.00017355, -0.00143876) + float3 physics:diagonalInertia = (0.00018332961, 0.0001474641, 0.0001467863) + float physics:mass = 0.28875807 + quatf physics:principalAxes = (0.998779, 0.045774184, -0.0066371514, 0.017354852) + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } +} + diff --git a/unitree_z1/payloads/Physics/physx.usda b/unitree_z1/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..612aca0ac7c2e31d58524ba6be972826e59ea558 --- /dev/null +++ b/unitree_z1/payloads/Physics/physx.usda @@ -0,0 +1,87 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "z1_description" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +over "z1_description" +{ + over "link00" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + } + + over "link01" + { + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 2 + float physxJoint:maxJointVelocity = 179.99469 + } + } + + over "link02" + { + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + } + } + + over "link03" + { + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + } + } + + over "link04" + { + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + } + } + + over "link05" + { + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + } + } +} + diff --git a/unitree_z1/payloads/base.usda b/unitree_z1/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..6b911627c01c635e44116845a3a9bc682566155f --- /dev/null +++ b/unitree_z1/payloads/base.usda @@ -0,0 +1,351 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "z1_description" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "z1_description" +{ + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "link00" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + + def "collisions" ( + instanceable = false + ) + { + def Cylinder "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.0255, -0.0325, -0.0325), (0.0255, 0.0325, 0.0325)] + double height = 0.050999999046325684 + uniform token purpose = "guide" + double radius = 0.032499998807907104 + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.025499999523162842) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "link01" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.05849999934434891) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + } + + def Xform "link02" + { + quatd xformOp:orient = (0.73727738179026125, -1.5001114984168914e-16, 0.67559015852845083, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.10350000113248825) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + + def "collisions" ( + instanceable = false + ) + { + def Cylinder "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.051, -0.0325, -0.0325), (0.051, 0.0325, 0.0325)] + double height = 0.10199999809265137 + uniform token purpose = "guide" + double radius = 0.032499998807907104 + quatd xformOp:orient = (0.7071067690849304, 0.7071067690849304, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Cylinder "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.1175, -0.0225, -0.0225), (0.1175, 0.0225, 0.0225)] + double height = 0.23499999940395355 + uniform token purpose = "guide" + double radius = 0.02250000089406967 + quatd xformOp:orient = (0.7071067690849304, 0, 0.7071067690849304, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.16249999403953552, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Cylinder "mesh_2" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.0255, -0.0325, -0.0325), (0.0255, 0.0325, 0.0325)] + double height = 0.050999999046325684 + uniform token purpose = "guide" + double radius = 0.032499998807907104 + quatd xformOp:orient = (0.7071067690849304, 0.7071067690849304, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.3499999940395355, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "link03" + { + quatd xformOp:orient = (0.99976202707990913, -4.8438775289840773e-18, 0.021814885034561013, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (-0.030504555870162382, 7.0942238343668228e-17, 0.45216813546489187) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + + def "collisions" ( + instanceable = false + ) + { + def Cylinder "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.058, -0.02, -0.02), (0.058, 0.02, 0.02)] + double height = 0.11599999666213989 + uniform token purpose = "guide" + double radius = 0.019999999552965164 + quatd xformOp:orient = (0.7071067690849304, 0, 0.7071067690849304, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.12800000607967377, 0, 0.054999999701976776) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Cylinder "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.0295, -0.0325, -0.0325), (0.0295, 0.0325, 0.0325)] + double height = 0.05900000035762787 + uniform token purpose = "guide" + double radius = 0.032499998807907104 + quatd xformOp:orient = (0.4999999701976776, -0.4999999701976776, 0.4999999701976776, 0.4999999701976776) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.22050000727176666, 0, 0.054999999701976776) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Xform "link04" + { + quatd xformOp:orient = (0.99976202707990913, -4.8438775289840773e-18, 0.021814885034561013, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.18977425627559028, 7.1448237450940547e-17, 0.49960485790798131) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + + def "collisions" ( + instanceable = false + ) + { + } + } + + def Xform "link05" + { + quatd xformOp:orient = (0.99976202707990913, -4.8438775289840773e-18, 0.021814885034561013, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.25970763208405989, 7.1433443842479291e-17, 0.49655150077940824) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + } + + def Xform "link06" + { + quatd xformOp:orient = (0.99976202707990913, -4.8438775289840773e-18, 0.021814885034561013, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.30886080296618401, 7.1423046049490556e-17, 0.4944054269917515) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "mesh_0" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + + def Scope "Looks" + { + } + } + + def "collisions" ( + instanceable = false + ) + { + def Cylinder "mesh_0" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + uniform token axis = "Z" + float3[] extent = [(-0.0255, -0.0325, -0.0325), (0.0255, 0.0325, 0.0325)] + double height = 0.050999999046325684 + uniform token purpose = "guide" + double radius = 0.032499998807907104 + quatd xformOp:orient = (0.7071067690849304, 0, 0.7071067690849304, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.025499999523162842, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/unitree_z1/payloads/geometries.usd b/unitree_z1/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..490ae41da446cb1e42128e8504a7f5b462f0d5a9 --- /dev/null +++ b/unitree_z1/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d39c3ae2c1d034215076d1ac7bf87feb14ea3840973b90f2c9ffc53ae8114d71 +size 12815717 diff --git a/unitree_z1/payloads/instances.usda b/unitree_z1/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..8b2b15c3d8231acf79e70891605ca73b3d650cfc --- /dev/null +++ b/unitree_z1/payloads/instances.usda @@ -0,0 +1,298 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh_0" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_0_1" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_0_2" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_0_3" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_0_4" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_0_5" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } + + def Xform "mesh_0_6" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_0_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "OmniSurface_BrushedMetal" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + token inputs:varname = "st" + float2 outputs:result + } + } + } + } +} + diff --git a/unitree_z1/payloads/materials.usda b/unitree_z1/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..3ef222a1b2e18b8e54ea06f42b4b1dd623d1ed97 --- /dev/null +++ b/unitree_z1/payloads/materials.usda @@ -0,0 +1,138 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "OmniSurface_BrushedMetal" + { + custom token[] omni:simready:nonvisual:attributes = ["none"] + custom token omni:simready:nonvisual:base = "aluminum" + custom token omni:simready:nonvisual:coating = "none" + token outputs:displacement ( + displayGroup = "Outputs" + ) + prepend token outputs:mdl:displacement.connect = + prepend token outputs:mdl:surface.connect = + prepend token outputs:mdl:volume.connect = + token outputs:mtlx:surface.connect = + token outputs:surface ( + displayGroup = "Outputs" + ) + token outputs:surface.connect = + token outputs:volume ( + displayGroup = "Outputs" + ) + + def Shader "Shader" ( + apiSchemas = ["NodeDefAPI"] + ) + { + token info:implementationSource = "sourceAsset" + asset info:mdl:sourceAsset = @./../materials/mdl/OmniSurfacePresets.mdl@ + token info:mdl:sourceAsset:subIdentifier = "OmniSurface_BrushedMetal" + color3f inputs:coat_color = (1, 1, 1) ( + customData = { + float3 default = (1, 1, 1) + } + displayGroup = "Coat" + hidden = false + renderType = "color" + ) + color3f inputs:diffuse_reflection_color = (0.45, 0.47, 0.55) ( + customData = { + float3 default = (0.5, 0.5, 0.5) + } + displayGroup = "Base" + hidden = false + renderType = "color" + ) + float inputs:diffuse_reflection_roughness = 0 ( + customData = { + double default = 0 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Base" + hidden = false + ) + float inputs:diffuse_reflection_weight = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Base" + hidden = false + ) + float inputs:metalness = 1 ( + customData = { + double default = 1 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Base" + hidden = false + ) + color3f inputs:specular_reflection_color = (0.000001, 9.198312e-7, 9.198312e-7) ( + customData = { + float3 default = (0, 0, 0) + } + displayGroup = "Specular" + hidden = false + renderType = "color" + ) + float inputs:specular_reflection_roughness = 0.58 ( + customData = { + double default = 0.25 + dictionary range = { + double max = 1 + double min = 0 + } + } + displayGroup = "Specular" + hidden = false + ) + token outputs:out ( + renderType = "material" + ) + } + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.45, 0.47, 0.55) + float inputs:metallic = 1 + float inputs:opacity = 1 + float inputs:roughness = 0.58 + token outputs:surface + } + + def Shader "SimReadyUV" + { + token info:id = "UsdPrimvarReader_float2" + string inputs:varname = "st" + float2 outputs:result + } + + def Shader "AgentfixOpenPBRSurface" + { + uniform token info:id = "ND_open_pbr_surface_surfaceshader" + color3f inputs:base_color = (0.5, 0.5, 0.5) + float inputs:base_metalness = 0 + float inputs:specular_roughness = 0.5 + token outputs:out + } + } +} + diff --git a/unitree_z1/payloads/robot.usda b/unitree_z1/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..6b8c92be258017d1bd78fa30f6a06421db640adf --- /dev/null +++ b/unitree_z1/payloads/robot.usda @@ -0,0 +1,115 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "z1_description" + metersPerUnit = 1 + upAxis = "Z" +) + +over "z1_description" ( + prepend apiSchemas = ["IsaacRobotAPI"] +) +{ + string isaac:namespace ( + displayName = "Namespace" + doc = "Namespace of the prim in Isaac Sim" + ) + prepend rel isaac:physics:robotJoints = [ + , + , + , + , + , + , + , + ] + prepend rel isaac:physics:robotLinks = [ + , + , + , + , + , + , + , + ] + token isaac:robotType = "Manipulator" + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "link00" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + over "joint1" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "link01" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + over "joint2" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "link02" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + over "joint3" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "link03" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + over "joint4" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "link04" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + over "joint5" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "link05" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + over "joint6" ( + prepend apiSchemas = ["IsaacJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + } + } + + over "link06" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + } +} diff --git a/unitree_z1/runnables/physics/mujoco.usda b/unitree_z1/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..7ead91d2ac632069910748662f7eb3f78dc3a370 --- /dev/null +++ b/unitree_z1/runnables/physics/mujoco.usda @@ -0,0 +1,212 @@ +#usda 1.0 +( + defaultPrim = "z1_description" +) + +def "z1_description" +{ + over "link00" + { + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + } + + over "joint1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link02" + { + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + + over "mesh_2" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + } + + over "joint3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link03" + { + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + } + + over "joint4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link06" + { + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["MjcCollisionAPI"] + ) + { + } + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_z1_description_link00_joint1" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28647.88975654116, -2864.7889756541163] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_z1_description_link01_joint2" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28647.88975654116, -2864.7889756541163] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 60 + double mjc:forceRange:min = -60 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_z1_description_link02_joint3" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28647.88975654116, -2864.7889756541163] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_z1_description_link03_joint4" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28647.88975654116, -2864.7889756541163] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_z1_description_link04_joint5" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28647.88975654116, -2864.7889756541163] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_z1_description_link05_joint6" ( + doc = "Source-derived force-drive PD bias; control is additive effort. Zero control preserves source position and velocity targets. Standard USD drive is retained for neutral and other runtimes; MuJoCo consumers must use this actuator exclusively." + ) + { + double[] mjc:biasPrm = [0, -28647.88975654116, -2864.7889756541163] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 30 + double mjc:forceRange:min = -30 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + } + + over "link01" + { + over "joint2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link04" + { + over "joint5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + over "link05" + { + over "joint6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } +} + diff --git a/unitree_z1/runnables/physics/newton.usda b/unitree_z1/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..6263f8f0a3b76ebf579ce1e55e8fa5cb8fd76496 --- /dev/null +++ b/unitree_z1/runnables/physics/newton.usda @@ -0,0 +1,121 @@ +#usda 1.0 +( + defaultPrim = "z1_description" + metersPerUnit = 1 + upAxis = "Z" +) + +over "z1_description" +{ + over "root_joint" ( + prepend apiSchemas = ["NewtonArticulationRootAPI"] + ) + { + bool newton:selfCollisionEnabled = 0 + } + + over "link00" + { + over "joint1" + { + float drive:angular:physics:damping = 2 + } + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + } + } + + over "link01" + { + over "joint2" + { + float drive:angular:physics:damping = 4 + } + } + + over "link02" + { + over "joint3" + { + float drive:angular:physics:damping = 2 + } + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + + over "mesh_2" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + } + } + + over "link03" + { + over "joint4" + { + float drive:angular:physics:damping = 2 + } + + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + } + } + + over "link04" + { + over "joint5" + { + float drive:angular:physics:damping = 2 + } + } + + over "link05" + { + over "joint6" + { + float drive:angular:physics:damping = 1 + } + } + + over "link06" + { + over "collisions" + { + over "mesh_0" ( + prepend apiSchemas = ["NewtonCollisionAPI"] + ) + { + } + } + } +} diff --git a/unitree_z1/runnables/physics/physx.usda b/unitree_z1/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..8de7eaefe61305f7dacccbb4637690e2c64466ac --- /dev/null +++ b/unitree_z1/runnables/physics/physx.usda @@ -0,0 +1,96 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "z1_description" + metersPerUnit = 1 + upAxis = "Z" +) + +over "z1_description" +{ + over "link00" + { + over "joint1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + float state:angular:physics:position = 0.23386763 + float state:angular:physics:velocity = 0.21788985 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + } + + over "link01" + { + over "joint2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 2 + float physxJoint:maxJointVelocity = 179.99469 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "link02" + { + over "joint3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "link03" + { + over "joint4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "link04" + { + over "joint5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } + + over "link05" + { + over "joint6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:jointFriction = 1 + float physxJoint:maxJointVelocity = 179.99469 + float state:angular:physics:position = 0 + float state:angular:physics:velocity = 0 + } + } +} + diff --git a/unitree_z1/z1.usda b/unitree_z1/z1.usda new file mode 100644 index 0000000000000000000000000000000000000000..4cff5fd691b3ab9040ed60968914557751552ff6 --- /dev/null +++ b/unitree_z1/z1.usda @@ -0,0 +1,371 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/z1_description" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/z1_description" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/z1_description" + string variantSetName = "PhysX" + } + } + } + dictionary validation = { + string profile = "Robot-Body" + string profile_version = "3.0.0" + dictionary validated_features = { + dictionary "2026-10-20" = { + dictionary "CAP000_Core.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP000_Core.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP000_Core.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP003_RigidBody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP003_RigidBody.MuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP004_Multibody.RobotMuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP021_RobotCore.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "CAP022_DrivenJoints.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP004_Multibody.RobotMuJoCo.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP023_RobotMaterials.Isaac.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.MuJoCo.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP024_BaseArticulation.PhysX.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP024_BaseArticulation.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP025_RosBridge.Ros.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + string "optional requirements" = "['com.nvidia.simready.ROS.001']" + bool passed = 0 + string version = "0-1-0" + } + dictionary "CAP031_SelfContainedPackage.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "CAP033_SimReadyPackage.OpenUSD.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['CAP031_SelfContainedPackage.OpenUSD.0-1-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "CAP100_IsaacComposition.Isaac.0-3-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-3-0" + } + dictionary "FET001_MinimalPlaceableVisual.OpenUSD.1-0-1" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "1-0-1" + } + dictionary "FET003_RigidBody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET003_RigidBody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET003_RigidBody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.Newton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET004_Multibody.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET004_Multibody.PhysX.0-4-0" = { + bool blocking_failure = 0 + string dependencies = "['FET003_RigidBody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-4-0" + } + dictionary "FET004_Multibody.RobotNewton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET006_Materials.MDL.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET006_Materials.Openpbr.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET010_DisplayColor.OpenUSD.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "[]" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.Isaac.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET022_DrivenJoints.PhysX.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.Newton.0-1-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.RobotNewton.0-1-0']" + bool passed = 1 + string version = "0-1-0" + } + dictionary "FET022_DrivenJoints.OpenUSD.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.OpenUSD.0-2-0']" + bool passed = 1 + string version = "0-2-0" + } + dictionary "FET022_DrivenJoints.PhysX.0-2-0" = { + bool blocking_failure = 0 + string dependencies = "['FET004_Multibody.PhysX.0-4-0']" + bool passed = 1 + string version = "0-2-0" + } + } + } + } + } + float3 asset_extents = (0.43574995, 0.1319351, 0.19799997) + string asset_license = "Unknown - not verified; no permissions asserted" + string asset_name = "z1" + string asset_type = "robot" + string author = "Unitree" + string category = "robotic arm" + string distribution_policy = "Internal handling policy: exclude from redistribution until applicable rights are verified. This policy grants no license or viewing permission." + string license_status = "unverified" + double mass = 4.4187202751636505 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Unitree/Z1/z1.usda" + string usage_clearance = "Pending source-license or rights-holder verification" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "z1_description" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "z1_description" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + } + prepend variantSets = ["PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "link00" + { + over "collisions" + { + over "mesh_0" + { + token visibility = "invisible" + } + } + } + + over "link02" + { + over "collisions" + { + over "mesh_0" + { + token visibility = "invisible" + } + + over "mesh_1" + { + token visibility = "invisible" + } + + over "mesh_2" + { + token visibility = "invisible" + } + } + } + + over "link03" + { + over "collisions" + { + over "mesh_0" + { + token visibility = "invisible" + } + + over "mesh_1" + { + token visibility = "invisible" + } + } + } + + over "link06" + { + over "collisions" + { + over "mesh_0" + { + token visibility = "invisible" + } + } + } + variantSet "PhysX" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/physx.usda@ + ) { + + } + } + variantSet "Newton" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/newton.usda@ + ) { + + } + } + variantSet "MuJoCo" = { + "Disabled" { + + } + "Enabled" ( + prepend payload = @./runnables/physics/mujoco.usda@ + ) { + + } + } +} +