diff --git a/.gitattributes b/.gitattributes index bb140060fea32dc53c526e2f108dcfe96e84cd94..3b2ec8cb3c5c6ace08e016b4a074bcef17b04d52 100644 --- a/.gitattributes +++ b/.gitattributes @@ -69,3 +69,14 @@ fanuc_crx10ia_lp/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text fanuc_crx20ia_l/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text fanuc_crx30ia/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text fanuc_crx5ia/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_er4ia/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate10_11a/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate10_11afc/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate14_7d/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id14l/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id4s/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id7c/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id7l/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id7lc/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text +fanuc_lrmate200id7we/payloads/geometries.usd filter=lfs diff=lfs merge=lfs -text diff --git a/fanuc_er4ia/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_er4ia/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..01575c438392c1760ef6398fb048f4c8c52b8be7 --- /dev/null +++ b/fanuc_er4ia/.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:15", + "assets": [ + { + "asset": "er4ia.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/fanuc_er4ia/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_er4ia/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..f62d3230e18656de23dcb05b73226f85b4f5733c --- /dev/null +++ b/fanuc_er4ia/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.er4ia.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "d63f5e28224ea17c54c35b50d767ef8f47ebbe693ae4edecf907cc662c92f88e", + "sha256": "028fb4cde5722883113169d3c236ed4b964391183bba80cb2a48340955057810" + } + }, + { + "relative_path": ".thumbs/256x256/er4ia.usda.png", + "size": 43072, + "hash": { + "sha256-flat-1mb": "b0732520e417edf6d04d8938d3a4ba72c62a645739587862fcabc3a63572d22e", + "sha256": "fcecbb681cd6a6118f9bb6dde09d2732b32bc6e9a872694bd8279b82018e8f7b" + } + }, + { + "relative_path": ".thumbs/er4ia.thumb.usd", + "size": 6122, + "hash": { + "sha256-flat-1mb": "ff5740c8525bc415e83e96e496479d4212f1bd5290e0cb86aa4ea8513f07c0c8", + "sha256": "799b844bfb5e12a76bbfa50ec368ef7e324dc6f9ad40171728efb02232a44ed0" + } + }, + { + "relative_path": "er4ia.usda", + "size": 15969, + "hash": { + "sha256-flat-1mb": "06d3caa8733deb89c323831e6ecce4471be75c9c48e3ec1645658f57d97ffc8b", + "sha256": "064744746931414ef07e1420ca17d33430c5ac80f810b6472ed771a1faa82254" + } + }, + { + "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": 2913, + "hash": { + "sha256-flat-1mb": "eacd5b52fb7ccb32cd880b146ef9f483412d5a4d72970356271f41b07c992b88", + "sha256": "fba19ad6e751be36e78f8df2b232eb2670a10daf23d33d0fdd68d3e411c61e50" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 127, + "hash": { + "sha256-flat-1mb": "02511ecfaf04bc38ed688198da9d150536f558e2ee65ff0a45480d787342b957", + "sha256": "f3397bc23433df1dc4dcbaf285780174dc0f951d1933565b958d23aa44cc9b1d" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 11971, + "hash": { + "sha256-flat-1mb": "0155907becdd25191d375b0ecff6f4a0fe0e4d177055a7ee7f8f65e1095b407e", + "sha256": "4bf2598786bcbd4f72c4d9d85cd639b1634fd0518f7dc60411cb7ebe32085bb2" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1428, + "hash": { + "sha256-flat-1mb": "2750d43dfa025800b034cea6222b99619685cd1473170f0588cbc759c58b756a", + "sha256": "c80d4c34ebc0c10a4e4599e852b3d6ee0aa4464fbaafb5d08a7b439a8f089820" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 127, + "hash": { + "sha256-flat-1mb": "02511ecfaf04bc38ed688198da9d150536f558e2ee65ff0a45480d787342b957", + "sha256": "f3397bc23433df1dc4dcbaf285780174dc0f951d1933565b958d23aa44cc9b1d" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 133, + "hash": { + "sha256-flat-1mb": "f561b530b3bc6ab14b20c0bc7f2037bc64516b66751fd4474bf4b8f2ffc6bc00", + "sha256": "5e60b100c7dcf425fa32903ac794a7ed89cb8c6493f1669e2e4cb5a2965fd437" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11491, + "hash": { + "sha256-flat-1mb": "1de8927b00c9c0f710bc35a3cbe11d0f85d434f2bb7ea517ca4cf546d1bb2aeb", + "sha256": "7c18194fb71e10ace96c56be3b3c40b4edd90a0de1e2d7c7cbc3189903995ffa" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 7323387, + "hash": { + "sha256-flat-1mb": "f895b009ba7f6e610a1b29f22cd68155444aa899ac4df4ff5070f657b9b77afa", + "sha256": "b2dc8cb5bed1696928d2bf996b2e256fbfed158b08b2b1f7abba34e72dace0a8", + "sha256-first1m": "f298492e98d117a71eb55c33e1bd38631d4c66f71719b70fd8c216b1f29cd5bb" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 40995, + "hash": { + "sha256-flat-1mb": "5fd6693e43d656133f1b5a5e9d38545f7892ed813510011a29634a9932efac50", + "sha256": "cb60a8572d2d4094382a19a36a9f7324f06569d6f9c8c589b3586ede5d208341" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61351, + "hash": { + "sha256-flat-1mb": "e407d4c5f1504e2ac9ac5a2c6564a44c31f08e312315216327a1e905e75f0f8c", + "sha256": "b6f7a4033754138bc926e94ad5876af85b8d8d2746b9bc82565aac0817fa7a29" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 2881, + "hash": { + "sha256-flat-1mb": "55bb5013f40b4f82081596f53c9cb4db3b22caf9dda72b591c805d07f154a601", + "sha256": "24b5b14f46cb96f7a7b8473fd5c64cc68248ecc905d4ad0521ec8ba5837832e6" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8106, + "hash": { + "sha256-flat-1mb": "d823517e4b0ef7f2ea9486e3de89ef63de84a94724a7ef1c296a4de07bf34fe7", + "sha256": "feb581a22a03ccb5a339894c7b6a65806cc946bf4d90a6f7b51eac910077a36c" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4893, + "hash": { + "sha256-flat-1mb": "63a694bd6b6a32149a527697a575531505767a0ecf1a977d8d2d1a8d58558623", + "sha256": "0e2a90e64ca50662f6cef450a4787a6841c29dcdbba91b7ee870ae1af0e38db8" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3518, + "hash": { + "sha256-flat-1mb": "16bfa1ff2a833540e9421a9e6a697caf493fba56a7325833d59ba909936a58d8", + "sha256": "0e285d2a27a661fd155f000aa938553dd42f1833a25503e2ea304fa890453999" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_er4ia/.metadata/com.nvidia.simready.root_usds.json b/fanuc_er4ia/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..cfae8221f93763105f7b7268a3f238475b64afe4 --- /dev/null +++ b/fanuc_er4ia/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "er4ia.usda" + ] +} diff --git a/fanuc_er4ia/.metadata/license.txt b/fanuc_er4ia/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_er4ia/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_er4ia/.simready/validation.json b/fanuc_er4ia/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_er4ia/.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/fanuc_er4ia/.thumbs/256x256/.er4ia.usda.last_generated b/fanuc_er4ia/.thumbs/256x256/.er4ia.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..92a238eea875e77acc0d579757c226e9007ebdee --- /dev/null +++ b/fanuc_er4ia/.thumbs/256x256/.er4ia.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:26 \ No newline at end of file diff --git a/fanuc_er4ia/.thumbs/256x256/er4ia.usda.png b/fanuc_er4ia/.thumbs/256x256/er4ia.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..5b91485453989b109a86108cf27430e175cd1790 --- /dev/null +++ b/fanuc_er4ia/.thumbs/256x256/er4ia.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcecbb681cd6a6118f9bb6dde09d2732b32bc6e9a872694bd8279b82018e8f7b +size 43072 diff --git a/fanuc_er4ia/.thumbs/er4ia.thumb.usd b/fanuc_er4ia/.thumbs/er4ia.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..4593db5e3308fcdcb91861d6d2bbd2c9841321dc Binary files /dev/null and b/fanuc_er4ia/.thumbs/er4ia.thumb.usd differ diff --git a/fanuc_er4ia/com.nvidia.simready.packaging.json b/fanuc_er4ia/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..825b99edeaf50135119285f3c5744dee24cee323 --- /dev/null +++ b/fanuc_er4ia/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_er4ia.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "87c7c09bd36e7e182c4cb62b1e923198267d484a569ed35bf65ea9adf1abc6d2" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "cf6f6df244223be6e751e521793bff091ac77a4753c8bf476cbe0d66f1db3e85" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "1ba37bc7d2edd8c592e0a260e53b4d39612cae021eba3b5eb9925e40ff5d4c75" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "843040ded8c5fa52ad0b10d3a5318eec8b794d9d9c607169032d957945071ca7" + }, + "package_hash": { + "sha256": "5fe7b39a7f2ace1a801874ceee3a38b665ae4028d8c8fe2cff73720aba86b876" + } +} diff --git a/fanuc_er4ia/er4ia.usda b/fanuc_er4ia/er4ia.usda new file mode 100644 index 0000000000000000000000000000000000000000..8ccf45abe5ecbad9cf2bf2b2f590fa1939ca9cf8 --- /dev/null +++ b/fanuc_er4ia/er4ia.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/er4ia" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/er4ia" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/er4ia" + 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.52720046, 0.19500296, 0.6664013) + string asset_license = "CC-BY-4.0" + string asset_name = "er4ia" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 20.00380024779588 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/er4ia/er4ia.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "er4ia" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_er4ia/materials/mdl/LICENSE.md b/fanuc_er4ia/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/materials/mdl/OmniPBR.mdl b/fanuc_er4ia/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/materials/mdl/OmniPBRBase.mdl b/fanuc_er4ia/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_er4ia/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/materials/mdl/aux_definitions.mdl b/fanuc_er4ia/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/materials/mdl/core_definitions.mdl b/fanuc_er4ia/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/materials/mdl/support_definitions.mdl b/fanuc_er4ia/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_er4ia/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/fanuc_er4ia/payloads/Physics/mujoco.usda b/fanuc_er4ia/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..40be7751bc48b3ee52bc20444ac0114aca0d7877 --- /dev/null +++ b/fanuc_er4ia/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "er4ia" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_er4ia/payloads/Physics/none.usda b/fanuc_er4ia/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..260d52d61bb9ec32fbbbe3836b71c058e7ac984f --- /dev/null +++ b/fanuc_er4ia/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +def "er4ia" +{ +} + diff --git a/fanuc_er4ia/payloads/Physics/physics.usda b/fanuc_er4ia/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..167b4bf2fe3361ba82dfb36df89c4d325c4f4deb --- /dev/null +++ b/fanuc_er4ia/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +over "er4ia" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 400 + float drive:angular:physics:stiffness = 2500 + 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.4516096 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -169.99998 + float physics:upperLimit = 169.99998 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 300 + float drive:angular:physics:stiffness = 2500 + 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.3285731 + 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) + float physics:lowerLimit = -109.99999 + float physics:upperLimit = 120 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 2500 + 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.47298396 + point3f physics:localPos0 = (0, 0, 0.26) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -68.99999 + float physics:upperLimit = 204.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 2500 + 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.16068363 + point3f physics:localPos0 = (0, 0, 0.02) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 2500 + 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.054614455 + point3f physics:localPos0 = (0.29, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -120 + float physics:upperLimit = 120 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.00009511787 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0281, 0.00396, 0.0799) + float3 physics:diagonalInertia = (0.021764794, 0.03024627, 0.029488938) + float physics:mass = 5.15 + quatf physics:principalAxes = (0.9960849, 0.061740834, 0.00030157834, 0.06326905) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00151, 0.000041, -0.0578) + float3 physics:diagonalInertia = (0.025207747, 0.01899999, 0.016192263) + float physics:mass = 4.17 + quatf physics:principalAxes = (0.9998926, 0.00023814883, -0.014649395, -0.0005277535) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00721, -0.000956, 0.13) + float3 physics:diagonalInertia = (0.07690479, 0.06720917, 0.025186036) + float physics:mass = 6.67 + quatf physics:principalAxes = (0.99995553, -0.00753474, 0.00461813, 0.0032855284) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00781, -0.00446, -0.00000291) + float3 physics:diagonalInertia = (0.0034358436, 0.0042493218, 0.004394834) + float physics:mass = 1.66 + quatf physics:principalAxes = (0.9630641, 0.032912303, -0.26695275, 0.012676877) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.187, 0.00165, 0.00184) + float3 physics:diagonalInertia = (0.0026594459, 0.011499464, 0.01160109) + float physics:mass = 1.95 + quatf physics:principalAxes = (0.99933004, 0.036387328, 0.0039215116, -0.0003486877) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0172, 0.000903, -0.00000423) + float3 physics:diagonalInertia = (0.00026780626, 0.00045319373, 0.000425) + float physics:mass = 0.39 + quatf physics:principalAxes = (0.9998693, -0.0003113006, -0.00002626526, -0.0161659) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.069, 5.91e-19, -2.85e-19) + float3 physics:diagonalInertia = (0.00000274, 0.00000153, 0.00000153) + float physics:mass = 0.0138 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_er4ia/payloads/Physics/physx.usda b/fanuc_er4ia/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..e52b68227fa7f1479e17bbd4b24fe451e4d80924 --- /dev/null +++ b/fanuc_er4ia/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "er4ia" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 460 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 360 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 899.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_er4ia/payloads/Sensor/none.usda b/fanuc_er4ia/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..260d52d61bb9ec32fbbbe3836b71c058e7ac984f --- /dev/null +++ b/fanuc_er4ia/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +def "er4ia" +{ +} + diff --git a/fanuc_er4ia/payloads/Sensor/sensors.usda b/fanuc_er4ia/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..175be20e6f9bee6c60305b70eb3f8a403c86b535 --- /dev/null +++ b/fanuc_er4ia/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "er4ia" +{ +} + diff --git a/fanuc_er4ia/payloads/base.usda b/fanuc_er4ia/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..bcaa7209ce9f302de2f2dd749e4d3f1ef1ff2523 --- /dev/null +++ b/fanuc_er4ia/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "er4ia" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.5900000333786011) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.6100000143051147) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.28999999165534973, 0, 0.6100000143051147) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.28999999165534973, 0, 0.6100000143051147) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07000000029802322, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_er4ia/payloads/geometries.usd b/fanuc_er4ia/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..29999e935c4b18ab59870662ce02345bd18dcee3 --- /dev/null +++ b/fanuc_er4ia/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2dc8cb5bed1696928d2bf996b2e256fbfed158b08b2b1f7abba34e72dace0a8 +size 7323387 diff --git a/fanuc_er4ia/payloads/instances.usda b/fanuc_er4ia/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..9396a42f37bf8cb54618389bfa6c1e32059db817 --- /dev/null +++ b/fanuc_er4ia/payloads/instances.usda @@ -0,0 +1,1174 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + 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_1" ( + 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_2" ( + 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_3" ( + 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_4" ( + 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_1" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_14" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.73333335, 0.73333335, 0.73333335) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_11" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_12" ( + 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_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_13" ( + 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_10" ( + 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_3" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_er4ia/payloads/materials.usda b/fanuc_er4ia/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..baa096370f7929a5957cc10d55a9d0d68ee9b369 --- /dev/null +++ b/fanuc_er4ia/payloads/materials.usda @@ -0,0 +1,1760 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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_1" + { + 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_1" ( + 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_2" + { + 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_2" ( + 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_3" + { + 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_3" ( + 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_4" + { + 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_4" ( + 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 "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: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_5" + { + 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_0" ( + 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, 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 = (1, 1, 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_6" + { + 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_1" ( + 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, 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 = (1, 1, 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_9" + { + 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_1" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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_14" + { + 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_2" ( + 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.73333335, 0.73333335, 0.73333335) ( + 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.73333335, 0.73333335, 0.73333335) + 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_11" + { + 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_3" ( + 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.8000001, 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.8000001, 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 + } + } +} + diff --git a/fanuc_er4ia/payloads/robot.usda b/fanuc_er4ia/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..ae6626f06ca824b317f91305a591774894fd8eb0 --- /dev/null +++ b/fanuc_er4ia/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +over "er4ia" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_er4ia/runnables/physics/mujoco.usda b/fanuc_er4ia/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..a18266bc4a2653ad6543a46f16c2458f0f691478 --- /dev/null +++ b/fanuc_er4ia/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "er4ia" +) + +def "er4ia" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_er4ia_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 400 + double mjc:forceRange:min = -400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_er4ia_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 300 + double mjc:forceRange:min = -300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_er4ia_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_er4ia_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_er4ia_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_er4ia_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_er4ia/runnables/physics/newton.usda b/fanuc_er4ia/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..b78ebb4ca235c7370665e270fa8b6c4f7f69c202 --- /dev/null +++ b/fanuc_er4ia/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "er4ia" +) + +over "er4ia" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 32.6087 + float newton:damping = 1.086957 + float newton:velocityLimit = 460 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 31.25 + float newton:damping = 1.041667 + float newton:velocityLimit = 360 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 14.4231 + float newton:damping = 0.480769 + float newton:velocityLimit = 520 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 3.3482 + float newton:damping = 0.111607 + float newton:velocityLimit = 559.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.0089 + float newton:damping = 0.066964 + float newton:velocityLimit = 559.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.8333 + float newton:damping = 0.027778 + float newton:velocityLimit = 899.99994 + } + } +} + diff --git a/fanuc_er4ia/runnables/physics/physx.usda b/fanuc_er4ia/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..5e2979749346d552a1d9ab0e2a331c9d4d994ce8 --- /dev/null +++ b/fanuc_er4ia/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "er4ia" + metersPerUnit = 1 + upAxis = "Z" +) + +over "er4ia" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 460 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 360 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 899.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..1b750f088ad049ff10c61ad1dceaf2255d6d88c5 --- /dev/null +++ b/fanuc_lrmate10_11a/.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:15", + "assets": [ + { + "asset": "lrmate10-11a.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/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..c2ac3069dc3e3368d33b11754dcbc792f930b452 --- /dev/null +++ b/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate10-11a.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "21bc6407761d525f452da88eca0425f26154f1aec1340d7f72faf5d641f99aaf", + "sha256": "c379667d26070a7d86c93b8223d41d65f2827212f52a5502e67384bcb7d2b801" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate10-11a.usda.png", + "size": 41877, + "hash": { + "sha256-flat-1mb": "6ece7e52967dc775abe354105c4548f0ec1ab874a6897c27120ba2e8e42d73bc", + "sha256": "f49bb677d93125ce745635003c33454e9844d6e31468a1f46306a2f9e9c6f451" + } + }, + { + "relative_path": ".thumbs/lrmate10-11a.thumb.usd", + "size": 6128, + "hash": { + "sha256-flat-1mb": "11b824f740deaa459543f4bc55708ae16bd609a061343f02d1e3cecf3a455f26", + "sha256": "3477eb3da07a3872b7c61b2b6463f25224d1b552892fe574e969a1e6269a5c53" + } + }, + { + "relative_path": "lrmate10-11a.usda", + "size": 16393, + "hash": { + "sha256-flat-1mb": "bdfe59e972632cdc83adb317f6f3d8db5371d9661db89ee5829c71dac407028a", + "sha256": "a4b93c822d3633108adb9cacef8ab3fbe04e72238a67b879c7184ac08dc7fd71" + } + }, + { + "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": 3524, + "hash": { + "sha256-flat-1mb": "20464886db4c0f824f78f4daced33888ab39f3331aabe124e56e0e47adc852c9", + "sha256": "57f681225a20322a80d41670063bb42c6ac94bd886366c180c4f56beeca3e781" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 141, + "hash": { + "sha256-flat-1mb": "964d8588b87d9d29a0b14c68be89a85ff1966b31c4906087d06a297cb53700ea", + "sha256": "f013dc19d42c042d108faab6762dff8afcdb5958955eb2471e0e552f263ab525" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12005, + "hash": { + "sha256-flat-1mb": "ad86edb743d302b34362f5ae991bf2c8ef49a584b7ed7e6163b3f0120fe7e399", + "sha256": "f88886a6ca6e7f338e6bd59fdb0c17c6fe094fb25c4713d9fbbd3470f7d0a81e" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1454, + "hash": { + "sha256-flat-1mb": "9bf6c4d6c086dbbe9703597cf8f83cbac819fe655e1b4e15bcde41b76808d046", + "sha256": "3ca317e89fb96b37e5d11bc90b80cb38beeb93501370c0d2dea789072a1b4b65" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 141, + "hash": { + "sha256-flat-1mb": "964d8588b87d9d29a0b14c68be89a85ff1966b31c4906087d06a297cb53700ea", + "sha256": "f013dc19d42c042d108faab6762dff8afcdb5958955eb2471e0e552f263ab525" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 147, + "hash": { + "sha256-flat-1mb": "e3bba7bf8772fbe923f4a28b413e70ac47dd79266871f3ce38a3eb3f0bd850a6", + "sha256": "d95a17bfc2204752ae21be58a73b6ee0824d5606ea2f7d4031c916f03a5e3352" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 12756, + "hash": { + "sha256-flat-1mb": "25e10267534471ce9900349a53efa98dd5e44b9bf9793fe4ba8f38b6c267b156", + "sha256": "a1fa35606c969556ce56a41c09e86c36f2869f0a86d33ee8a753e793e0b55b9d" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 5586171, + "hash": { + "sha256-flat-1mb": "61e45d08505c8d358f6a889e66e93f75495b7af7eaeb9a08b5ef4c222771f668", + "sha256": "840c53f79b2f95d934317987858645767830d49e89d87f4a9cb56c42451ef085", + "sha256-first1m": "e54566952554c91eda1d2582d2eb6c2cc582c86c1c950b23cf456d67531aeafb" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 30859, + "hash": { + "sha256-flat-1mb": "0ee6ceee00d503f43c487a743328e9a422af8e72bf910c5e682912a6fce02163", + "sha256": "c91a0ef6d78a0946a3ffdb799c33c6327f90e0aab6c985269b99f085e0f14e8a" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 55794, + "hash": { + "sha256-flat-1mb": "d39d2358cb638d76e28a854358500c88742b8c171fe9bb3377848950b74b8967", + "sha256": "7bfc8b8c89e6768cc6784a578092f25bb5ef2a6276d64d046d3ef49ca53d3cc3" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 2993, + "hash": { + "sha256-flat-1mb": "be0848825092c044809e03b828bb9b3970362691b7111f1ee9836e3c4077d0c2", + "sha256": "38e8e0252b70805fe2f0a98f69a02423a810c786882acae4698b0270793b9dd6" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8204, + "hash": { + "sha256-flat-1mb": "b03be7d861ee76a189c741ac9e56ab8e96405f4a7142acf2d18307c587666f1d", + "sha256": "db33263e0136b18d72e03e4d81c74a505a840c965100ea33efbdceec8231368d" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4910, + "hash": { + "sha256-flat-1mb": "34e251ce3b8a17f021ba28cee21100aef44056741e5822a0989479f8eb037131", + "sha256": "04304aa3772b895da8120171d05089c8d59127f45733b80f00b28cd835879c22" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3684, + "hash": { + "sha256-flat-1mb": "ea795f09cd4cd9546e3026f0a05ef4c524a00b094a5938516dcaae06a633ef1e", + "sha256": "a55daf058061d3d575e182b740778ef8a01179dedd83afef85628e2b190f13c5" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..72076b8620d46353770670eec1841114f1deb1ff --- /dev/null +++ b/fanuc_lrmate10_11a/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate10-11a.usda" + ] +} diff --git a/fanuc_lrmate10_11a/.metadata/license.txt b/fanuc_lrmate10_11a/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate10_11a/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate10_11a/.simready/validation.json b/fanuc_lrmate10_11a/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate10_11a/.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/fanuc_lrmate10_11a/.thumbs/256x256/.lrmate10-11a.usda.last_generated b/fanuc_lrmate10_11a/.thumbs/256x256/.lrmate10-11a.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..14a92757af6b8785bb70044e0dfe87b404649166 --- /dev/null +++ b/fanuc_lrmate10_11a/.thumbs/256x256/.lrmate10-11a.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:30 \ No newline at end of file diff --git a/fanuc_lrmate10_11a/.thumbs/256x256/lrmate10-11a.usda.png b/fanuc_lrmate10_11a/.thumbs/256x256/lrmate10-11a.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..57dc0c700ac170db7c835686f7db7c7fd8ea1fcb --- /dev/null +++ b/fanuc_lrmate10_11a/.thumbs/256x256/lrmate10-11a.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f49bb677d93125ce745635003c33454e9844d6e31468a1f46306a2f9e9c6f451 +size 41877 diff --git a/fanuc_lrmate10_11a/.thumbs/lrmate10-11a.thumb.usd b/fanuc_lrmate10_11a/.thumbs/lrmate10-11a.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..74b04e680bd1074f4cc18cad4050140fc514d749 Binary files /dev/null and b/fanuc_lrmate10_11a/.thumbs/lrmate10-11a.thumb.usd differ diff --git a/fanuc_lrmate10_11a/com.nvidia.simready.packaging.json b/fanuc_lrmate10_11a/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..2ebc9dee076942aca7d833027df7e8a363c82c8d --- /dev/null +++ b/fanuc_lrmate10_11a/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate10_11a.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "0e2c7b2f44fceb581cc2797a3e5880ae348485babd887a2bcdf35789a8460600" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "868c409a7e203656818cbf0f178fce579926c814bef5cb1707db313f84023de5" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "ebeb9aa718f1a61bf4bb007577237a5f526946ea172bfdbc551d1bdb808f05b7" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "d2caaf1978933bb75837bd3aaf1f5a4fd1c8f76ad6df5b4a2913e62ab6219c4f" + }, + "package_hash": { + "sha256": "88585118285c88ccc2edd9dd805738e318207a92e9a0a1007630625f062c11f9" + } +} diff --git a/fanuc_lrmate10_11a/lrmate10-11a.usda b/fanuc_lrmate10_11a/lrmate10-11a.usda new file mode 100644 index 0000000000000000000000000000000000000000..4b9aecf2911316d750aef08106e0ed1f5feef9cb --- /dev/null +++ b/fanuc_lrmate10_11a/lrmate10-11a.usda @@ -0,0 +1,434 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate10_11a" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate10_11a" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate10_11a" + 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.8064005, 0.3065404, 1.0545888) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate10-11a" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 46.0126013411209 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate10-11a/lrmate10-11a.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate10_11a" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate10_11a/materials/mdl/LICENSE.md b/fanuc_lrmate10_11a/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/materials/mdl/OmniPBR.mdl b/fanuc_lrmate10_11a/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate10_11a/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate10_11a/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/materials/mdl/aux_definitions.mdl b/fanuc_lrmate10_11a/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/materials/mdl/core_definitions.mdl b/fanuc_lrmate10_11a/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/materials/mdl/support_definitions.mdl b/fanuc_lrmate10_11a/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate10_11a/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/fanuc_lrmate10_11a/payloads/Physics/mujoco.usda b/fanuc_lrmate10_11a/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..022b42a08d224b5837ec9c4b6ab07499afc0621e --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/Physics/mujoco.usda @@ -0,0 +1,227 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11a" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + } + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + } + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + } + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + } + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + } + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + } + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + } + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate10_11a/payloads/Physics/none.usda b/fanuc_lrmate10_11a/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..9a963deedfefb29bc3fc5fa31de5cd66a44772b8 --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate10_11a" +{ +} + diff --git a/fanuc_lrmate10_11a/payloads/Physics/physics.usda b/fanuc_lrmate10_11a/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..5f0d038f38a55c60c8ade48be14e979834825e37 --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11a" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 800 + float drive:angular:physics:stiffness = 2500 + 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 = 1.1193554 + point3f physics:localPos0 = (0, 0, 0.4) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -185 + float physics:upperLimit = 185 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 900 + float drive:angular:physics:stiffness = 2500 + 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 = 1.1887671 + point3f physics:localPos0 = (0.025, 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 = -99.99999 + float physics:upperLimit = 135 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 300 + float drive:angular:physics:stiffness = 2500 + 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 = 3.404374 + point3f physics:localPos0 = (0, 0, 0.56) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 209.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.87057304 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 60 + float drive:angular:physics:stiffness = 2500 + 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.16708826 + point3f physics:localPos0 = (0.515, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 2500 + 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.00009964694 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.022899996, 0.0000229, 0.09779999) + float3 physics:diagonalInertia = (0.05319845, 0.07160005, 0.0715015) + float physics:mass = 8.31 + quatf physics:principalAxes = (0.9985726, 0.009608755, -0.052533865, 0.0008119707) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0144, 0.000328, -0.0617) + float3 physics:diagonalInertia = (0.13236281, 0.09409446, 0.09724275) + float physics:mass = 11.1 + quatf physics:principalAxes = (0.9949263, -0.01812503, 0.09885091, 0.0046554063) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.000213, 0.000368, 0.265) + float3 physics:diagonalInertia = (0.82400024, 0.77600014, 0.12199966) + float physics:mass = 19.6 + quatf physics:principalAxes = (0.99999946, 0.00034161398, -0.00011283636, 0.0009979607) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00103, 0.00127, 0.00775) + float3 physics:diagonalInertia = (0.006781095, 0.009752631, 0.009816272) + float physics:mass = 2.5 + quatf physics:principalAxes = (0.91417575, -0.36420256, -0.17002197, -0.052265503) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.332, -0.0000617, 0.000894) + float3 physics:diagonalInertia = (0.007589965, 0.066899955, 0.06850008) + float physics:mass = 4.09 + quatf physics:principalAxes = (0.99999624, -0.0027228405, 0.00036921128, 0.00007254863) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0184, 0.00109, -0.00000438) + float3 physics:diagonalInertia = (0.00029072186, 0.0005392781, 0.0004949999) + float physics:mass = 0.4 + quatf physics:principalAxes = (0.99986017, -0.00016219758, -0.000047306454, -0.016728247) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.074, 3.35e-18, -4.88e-19) + float3 physics:diagonalInertia = (0.00000258, 0.00000144, 0.00000144) + float physics:mass = 0.0126 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + rel physics:simulationOwner + + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsMeshCollisionAPI", "PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate10_11a/payloads/Physics/physx.usda b/fanuc_lrmate10_11a/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..54919adc266327e7a24fa928fd8b4856a9958140 --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate10_11a" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 299.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 339.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 499.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 799.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate10_11a/payloads/Sensor/none.usda b/fanuc_lrmate10_11a/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..9a963deedfefb29bc3fc5fa31de5cd66a44772b8 --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate10_11a" +{ +} + diff --git a/fanuc_lrmate10_11a/payloads/Sensor/sensors.usda b/fanuc_lrmate10_11a/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..42deedce7198cb6d2283cdbce6442bcc5e09c9ff --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate10_11a" +{ +} + diff --git a/fanuc_lrmate10_11a/payloads/base.usda b/fanuc_lrmate10_11a/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..489cc6bb32a89b62ad0ec14d6795122d0074d1ab --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/base.usda @@ -0,0 +1,401 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate10_11a" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.4000000059604645) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.4000000059604645) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02500000037252903, 0, 0.4000000059604645) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02500000037252903, 0, 0.9600000381469727) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02500000037252903, 0, 0.9950000643730164) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.5399999618530273, 0, 0.9950000643730164) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.5399999618530273, 0, 0.9950000643730164) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07999999821186066, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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 + ) + { + rel collection:collisionmeshes:includes = + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI"] + ) + { + } + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate10_11a/payloads/geometries.usd b/fanuc_lrmate10_11a/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..d87f6e4cfa5fc5871571c46fabc892e009bebb1f --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:840c53f79b2f95d934317987858645767830d49e89d87f4a9cb56c42451ef085 +size 5586171 diff --git a/fanuc_lrmate10_11a/payloads/instances.usda b/fanuc_lrmate10_11a/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..77a62f0a3380901211216655706d85772e123d49 --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/instances.usda @@ -0,0 +1,907 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4, 0.4, 0.4) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7529413, 0.6078432, 0.2980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_2" ( + 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_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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_4" ( + 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_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" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.6980392, 0.6980392, 0.6980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_8" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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_4" ( + 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_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/fanuc_lrmate10_11a/payloads/materials.usda b/fanuc_lrmate10_11a/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..0e8a868a4566e3d6e5b13a00de8c7478f7249429 --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/materials.usda @@ -0,0 +1,1601 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.4, 0.4, 0.4) ( + 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.4, 0.4, 0.4) + 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_1" + { + 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_1" ( + 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.7529413, 0.6078432, 0.2980392) ( + 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.7529413, 0.6078432, 0.2980392) + 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_2" + { + 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_2" ( + 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 "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: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_3" + { + 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_0" ( + 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, 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 = (1, 1, 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_4" + { + 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_1" ( + 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_5" + { + 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_1" ( + 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, 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 = (1, 1, 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_6" + { + 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_0" ( + 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_7" + { + 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_1" ( + 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.6980392, 0.6980392, 0.6980392) ( + 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.6980392, 0.6980392, 0.6980392) + 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_8" + { + 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_2" ( + 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.8000001, 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.8000001, 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 + } + } +} + diff --git a/fanuc_lrmate10_11a/payloads/robot.usda b/fanuc_lrmate10_11a/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..3c30e40537e7b2bc9adc2ef4bb35a6189087fd8a --- /dev/null +++ b/fanuc_lrmate10_11a/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11a" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate10_11a/runnables/physics/mujoco.usda b/fanuc_lrmate10_11a/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..e7a06e05ecb6e3c3335ed1d73c160976caa2d49d --- /dev/null +++ b/fanuc_lrmate10_11a/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate10_11a" +) + +def "lrmate10_11a" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate10_11a_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 800 + double mjc:forceRange:min = -800 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11a_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 900 + double mjc:forceRange:min = -900 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11a_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 300 + double mjc:forceRange:min = -300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11a_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11a_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate10_11a_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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 = + } + } +} + diff --git a/fanuc_lrmate10_11a/runnables/physics/newton.usda b/fanuc_lrmate10_11a/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..74f1be8f1d5bd5017a45b77fa975d1bc534c61f0 --- /dev/null +++ b/fanuc_lrmate10_11a/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate10_11a" +) + +over "lrmate10_11a" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 100 + float newton:damping = 3.333334 + float newton:velocityLimit = 299.99997 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 146.7391 + float newton:damping = 4.891304 + float newton:velocityLimit = 230 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 33.0882 + float newton:damping = 1.102941 + float newton:velocityLimit = 339.99997 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 5.25 + float newton:damping = 0.175 + float newton:velocityLimit = 499.99997 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 5.625 + float newton:damping = 0.1875 + float newton:velocityLimit = 399.99997 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 1.4062 + float newton:damping = 0.046875 + float newton:velocityLimit = 799.99994 + } + } +} + diff --git a/fanuc_lrmate10_11a/runnables/physics/physx.usda b/fanuc_lrmate10_11a/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..3d9e16ef5da97004a0a611fd4046018a86181d1e --- /dev/null +++ b/fanuc_lrmate10_11a/runnables/physics/physx.usda @@ -0,0 +1,178 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11a" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11a" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 299.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 339.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 499.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 799.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" ( + ) + { + over "base" + { + over "mesh_1" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" ( + ) + { + over "j1" + { + over "mesh_3" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" ( + ) + { + over "j2" + { + over "mesh_5" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" ( + ) + { + over "j3" + { + over "mesh_7" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" ( + ) + { + over "j4" + { + over "mesh_9" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" ( + ) + { + over "j5" + { + over "mesh_11" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" ( + ) + { + over "j6" + { + over "mesh_13" ( + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..8e4aef81409d27826c4b3d1217ba83d48c377842 --- /dev/null +++ b/fanuc_lrmate10_11afc/.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:15", + "assets": [ + { + "asset": "lrmate10-11afc.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/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..0bb98538452f083cb19f2e6ee5e0ef416ad4dd61 --- /dev/null +++ b/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate10-11afc.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "fdccbbcc5483026d5e344cbf3aacdc0ece478777f36656874adaf0c7fec8a7a5", + "sha256": "2136bbd7b3ad0791ed1b8bb81f1997d7e4128ef9fe70963e31ea9b17d05d41ef" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate10-11afc.usda.png", + "size": 36567, + "hash": { + "sha256-flat-1mb": "47c15e0f6db79089ddc20902ea5c00748ad5dc909a7a8b17276dda7993bb7cb7", + "sha256": "2f58b209741987d032052bb946989651bfe651f248940f4e2741d4e46d55e218" + } + }, + { + "relative_path": ".thumbs/lrmate10-11afc.thumb.usd", + "size": 6130, + "hash": { + "sha256-flat-1mb": "0a5467963f303cd57ad370330260c7812a931cf4e406f70c87b6614482ded6b2", + "sha256": "431b31477eea06a39e562b9dd5591ed9642d55fa19ad31ac79604f2174d14c57" + } + }, + { + "relative_path": "lrmate10-11afc.usda", + "size": 16040, + "hash": { + "sha256-flat-1mb": "debfa70e95b57a4f4d8d660712456a710274477b3928f4af3a2ac9b1e17e1266", + "sha256": "fdec53b48209eb3cb68e559b751d4c31400452a87ba422a2da341c75fff6f269" + } + }, + { + "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": 2922, + "hash": { + "sha256-flat-1mb": "40d5fe324d98f4fe4c987b8c94e94fd1a7a02a712d8f1830500f5426eb34ec89", + "sha256": "d7e59658646039be0549f450a85c9e3e4b78328d8686f84c7c6a40c294835e9a" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "795950480d8330f175bb4ae01293b1341e0c13e1566785828b23ff792c1780d8", + "sha256": "69ac6237fd834f6d26e02266bfd79fd12096f051507978c398278bf478ff04ea" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12115, + "hash": { + "sha256-flat-1mb": "6f1c224a1e87f5481e15f4e1266d7a3a29c392ee336e01c838ad8d6d39f67006", + "sha256": "ee2df9671dde7d620ddc0594b16577d949a887817d8792450ec8f40164bc779b" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1458, + "hash": { + "sha256-flat-1mb": "6db2d424d5f5a1b4ce315ce634425b6346f9e3485192164e106f2655dea62fab", + "sha256": "55fd5ed196abcc2683d9ff0a7661c0ba319573e695754f46be86b047ce915749" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "795950480d8330f175bb4ae01293b1341e0c13e1566785828b23ff792c1780d8", + "sha256": "69ac6237fd834f6d26e02266bfd79fd12096f051507978c398278bf478ff04ea" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 151, + "hash": { + "sha256-flat-1mb": "5ac6a2f33111919b3ca8bc0527b9a39e7cfb6e061ff6a3d6fba29e491a5a122e", + "sha256": "70acb2454e55e89c092a80c29331f08b4f84134501f0e0793b6d56e6ac7eab5a" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11558, + "hash": { + "sha256-flat-1mb": "7cdd7be5303bd8977d1a0fe00e26292b07ebb89d11966de28fae39208ff717cf", + "sha256": "e69bd434c17c325c5123594718669aa7d0372e68eaf5984c038743c09de2d15c" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 5672559, + "hash": { + "sha256-flat-1mb": "d798e7ae61249b46d58b2f4ebc6f6c3d1b12df79dbf227a480bf248c0c7ec56a", + "sha256": "4955d2578a8690ec3d1c289e36128a94b88c0a52b0a689a1db686d981db4b2a0", + "sha256-first1m": "3bd03b3486b15b9f72b689e4b5137dffda82e0d47159c0f0e587d71cb1532823" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 27198, + "hash": { + "sha256-flat-1mb": "cf841e358a8432827ae122e451b682e2a5e61fdba05936a6e10f46a8205f5616", + "sha256": "e9c54e9891b341648812ebd413fec2d118204a0959f4d768ea05495d04fb1dc7" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 39122, + "hash": { + "sha256-flat-1mb": "92c71f9c5af6960927d16a6034ac4be3bc3cf468ad378206af74ad8a9789c46c", + "sha256": "86c19f270d65d04830db33bb9476f0426b0985a9144944a0c78629d3e7c0ce87" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3025, + "hash": { + "sha256-flat-1mb": "f36910c4195290c88f3d06a60b2451b6d5e51036085a00d5afcd5870fbbb12e1", + "sha256": "361a6a3644e49dc65aedd5bc1545a0a08169f98f80a3f91b99fcd4933f6fa8a5" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8232, + "hash": { + "sha256-flat-1mb": "656982fb198c77735f1f14d3f4da4a50940b952e6cf3e440e3621dd13a7e6d82", + "sha256": "91dd7f8ddbb7808e7e81b04e5375799017bf0f31094e1809aeb048ef493a3303" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4914, + "hash": { + "sha256-flat-1mb": "f55eafd0b15f1bef8885f37a1d3469a21228f4018abc1d576e216b4bbd262da0", + "sha256": "e5dbb275c78d7c61d1576c7a4b30e08c827bcced3c42d32ba46a5346e4412583" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3548, + "hash": { + "sha256-flat-1mb": "272466f43a168ddcc5f4d3bb3b0a4034ca64ec8816d2eb6418af0b658aea25cf", + "sha256": "ee09b766840cd57bcf1c08b08a4cf603067715d577b1057bd3d188893bf10214" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..b32068df8411476f50ee4dbc9b4e44486940ffce --- /dev/null +++ b/fanuc_lrmate10_11afc/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate10-11afc.usda" + ] +} diff --git a/fanuc_lrmate10_11afc/.metadata/license.txt b/fanuc_lrmate10_11afc/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate10_11afc/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate10_11afc/.simready/validation.json b/fanuc_lrmate10_11afc/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate10_11afc/.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/fanuc_lrmate10_11afc/.thumbs/256x256/.lrmate10-11afc.usda.last_generated b/fanuc_lrmate10_11afc/.thumbs/256x256/.lrmate10-11afc.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..03d77855e301492a576ad2444cfbd39faf06f633 --- /dev/null +++ b/fanuc_lrmate10_11afc/.thumbs/256x256/.lrmate10-11afc.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:34 \ No newline at end of file diff --git a/fanuc_lrmate10_11afc/.thumbs/256x256/lrmate10-11afc.usda.png b/fanuc_lrmate10_11afc/.thumbs/256x256/lrmate10-11afc.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..401bcb0f528a005295f8bb3688444d638a374560 --- /dev/null +++ b/fanuc_lrmate10_11afc/.thumbs/256x256/lrmate10-11afc.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f58b209741987d032052bb946989651bfe651f248940f4e2741d4e46d55e218 +size 36567 diff --git a/fanuc_lrmate10_11afc/.thumbs/lrmate10-11afc.thumb.usd b/fanuc_lrmate10_11afc/.thumbs/lrmate10-11afc.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..036a712f3e80497a24ddac2267c7f7327db69515 Binary files /dev/null and b/fanuc_lrmate10_11afc/.thumbs/lrmate10-11afc.thumb.usd differ diff --git a/fanuc_lrmate10_11afc/com.nvidia.simready.packaging.json b/fanuc_lrmate10_11afc/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..6194e41d7bc83a64247bf1ca44ccc4259afd4936 --- /dev/null +++ b/fanuc_lrmate10_11afc/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate10_11afc.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "a892dc688d9e8baafb96165811a9cdae31b074d39f6408685ae67c6306b5705a" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "d608ca24f0a449f31ddad6c9ef23b22720b80aa0e3335fa32e7d78dd7f7c692c" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "9a586e15b1ab10cc11568db78182c53661fa5a85b7183b700a46e5e4f3093069" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "241015ee8dde505fe3d7f1172a4a31d1df21c08fae28b4a8ccd70f0a999070b2" + }, + "package_hash": { + "sha256": "07733347ce42713e599d012303898516b672e646fd45d642158cccd6a97be552" + } +} diff --git a/fanuc_lrmate10_11afc/lrmate10-11afc.usda b/fanuc_lrmate10_11afc/lrmate10-11afc.usda new file mode 100644 index 0000000000000000000000000000000000000000..65ec07a6212d767d46bb3aa715160b17d0127932 --- /dev/null +++ b/fanuc_lrmate10_11afc/lrmate10-11afc.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate10_11afc" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate10_11afc" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate10_11afc" + 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.81840044, 0.3065404, 1.0545888) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate10-11afc" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 46.05180110782385 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate10-11afc/lrmate10-11afc.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate10_11afc" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate10_11afc/materials/mdl/LICENSE.md b/fanuc_lrmate10_11afc/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/materials/mdl/OmniPBR.mdl b/fanuc_lrmate10_11afc/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate10_11afc/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate10_11afc/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/materials/mdl/aux_definitions.mdl b/fanuc_lrmate10_11afc/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/materials/mdl/core_definitions.mdl b/fanuc_lrmate10_11afc/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/materials/mdl/support_definitions.mdl b/fanuc_lrmate10_11afc/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate10_11afc/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/fanuc_lrmate10_11afc/payloads/Physics/mujoco.usda b/fanuc_lrmate10_11afc/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..5dc55aca76f5b8ba144d247573ca68561f2696af --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11afc" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate10_11afc/payloads/Physics/none.usda b/fanuc_lrmate10_11afc/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..cfe7a1c46995cc5fc8a14ea9e03513f0dca9200e --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate10_11afc" +{ +} + diff --git a/fanuc_lrmate10_11afc/payloads/Physics/physics.usda b/fanuc_lrmate10_11afc/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..64abe27de622410fe7930c065cfad172f2b2f349 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11afc" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 800 + float drive:angular:physics:stiffness = 2500 + 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 = 1.1182051 + point3f physics:localPos0 = (0, 0, 0.4) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -185 + float physics:upperLimit = 185 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 900 + float drive:angular:physics:stiffness = 2500 + 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 = 1.1889713 + point3f physics:localPos0 = (0.025, 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 = -99.99999 + float physics:upperLimit = 135 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 300 + float drive:angular:physics:stiffness = 2500 + 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 = 3.4378912 + point3f physics:localPos0 = (0, 0, 0.56) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 209.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.8971856 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 60 + float drive:angular:physics:stiffness = 2500 + 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.19591914 + point3f physics:localPos0 = (0.515, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 2500 + 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.00019970168 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0229, 0.0000229, 0.0978) + float3 physics:diagonalInertia = (0.053098455, 0.07150005, 0.07140149) + float physics:mass = 8.3 + quatf physics:principalAxes = (0.99857265, 0.0096025765, -0.052533843, 0.0008116597) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0144, 0.000328, -0.0617) + float3 physics:diagonalInertia = (0.13235508, 0.09399448, 0.09715044) + float physics:mass = 11.1 + quatf physics:principalAxes = (0.9949679, -0.018039042, 0.098448396, 0.0046339934) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.000213, 0.000368, 0.265) + float3 physics:diagonalInertia = (0.82300025, 0.7750001, 0.12199966) + float physics:mass = 19.6 + quatf physics:principalAxes = (0.99999946, 0.00034137157, -0.00011299675, 0.0009969146) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00103, 0.00127, 0.00775) + float3 physics:diagonalInertia = (0.00677054, 0.009801599, 0.009737862) + float physics:mass = 2.49 + quatf physics:principalAxes = (0.91765106, 0.3551502, -0.16055387, 0.07750751) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.332, -0.0000617, 0.000894) + float3 physics:diagonalInertia = (0.0075799646, 0.066799946, 0.06840009) + float physics:mass = 4.09 + quatf physics:principalAxes = (0.99999624, -0.0027197031, 0.00036975803, 0.00007257326) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0244, 0.00105, -0.00000729) + float3 physics:diagonalInertia = (0.000338727, 0.00070527307, 0.00065600005) + float physics:mass = 0.452 + quatf physics:principalAxes = (0.99990684, -0.00023664472, -0.000035027366, -0.013647211) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0836, -3.24e-19, -1.22e-18) + float3 physics:diagonalInertia = (0.00000474, 0.00000279, 0.00000279) + float physics:mass = 0.0198 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate10_11afc/payloads/Physics/physx.usda b/fanuc_lrmate10_11afc/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..50c98fe64415549793f5ba3931d8979d785dfc45 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate10_11afc" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 299.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 339.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 499.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 799.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate10_11afc/payloads/Sensor/none.usda b/fanuc_lrmate10_11afc/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..cfe7a1c46995cc5fc8a14ea9e03513f0dca9200e --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate10_11afc" +{ +} + diff --git a/fanuc_lrmate10_11afc/payloads/Sensor/sensors.usda b/fanuc_lrmate10_11afc/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..0ad8d10897405594ef7225dccffaacbc6e0624f4 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate10_11afc" +{ +} + diff --git a/fanuc_lrmate10_11afc/payloads/base.usda b/fanuc_lrmate10_11afc/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..23ebb1f4f1093c8f44005b830d6635158130e49b --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate10_11afc" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.4000000059604645) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.4000000059604645) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02500000037252903, 0, 0.4000000059604645) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02500000037252903, 0, 0.9600000381469727) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.02500000037252903, 0, 0.9950000643730164) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.5399999618530273, 0, 0.9950000643730164) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.5399999618530273, 0, 0.9950000643730164) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.09200000017881393, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate10_11afc/payloads/geometries.usd b/fanuc_lrmate10_11afc/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..2bc8a6a65af0badf855ad8eb0e93cbab061b0654 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4955d2578a8690ec3d1c289e36128a94b88c0a52b0a689a1db686d981db4b2a0 +size 5672559 diff --git a/fanuc_lrmate10_11afc/payloads/instances.usda b/fanuc_lrmate10_11afc/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..eecb67e1b57f844a84af89545717fa9fbad6f012 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/instances.usda @@ -0,0 +1,799 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4, 0.4, 0.4) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7529413, 0.6078432, 0.2980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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 "Material_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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 = 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 "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7294118, 0.7294118, 0.7294118) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 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_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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_2" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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/fanuc_lrmate10_11afc/payloads/materials.usda b/fanuc_lrmate10_11afc/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..b80903abefa70b26f225b90768da83dff9f8c9c7 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/materials.usda @@ -0,0 +1,1125 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.4, 0.4, 0.4) ( + 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.4, 0.4, 0.4) + 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_1" + { + 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_1" ( + 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.7529413, 0.6078432, 0.2980392) ( + 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.7529413, 0.6078432, 0.2980392) + 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_2" + { + 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_2" ( + 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_3" + { + 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_0" ( + 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:metallic_constant = 1 + 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 = 1 + 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_4" + { + 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_1" ( + 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.7294118, 0.7294118, 0.7294118) ( + 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.7294118, 0.7294118, 0.7294118) + 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_5" + { + 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_2" ( + 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, 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 = (1, 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_6" + { + 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_0" ( + 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/fanuc_lrmate10_11afc/payloads/robot.usda b/fanuc_lrmate10_11afc/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..a92fcbfb513dc0220c7a6deea75c3d4c361ca3a6 --- /dev/null +++ b/fanuc_lrmate10_11afc/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11afc" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate10_11afc/runnables/physics/mujoco.usda b/fanuc_lrmate10_11afc/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..2395fc04862a8796398d6f38ed4b30d12a6e8852 --- /dev/null +++ b/fanuc_lrmate10_11afc/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate10_11afc" +) + +def "lrmate10_11afc" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate10_11afc_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 800 + double mjc:forceRange:min = -800 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11afc_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 900 + double mjc:forceRange:min = -900 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11afc_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 300 + double mjc:forceRange:min = -300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11afc_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate10_11afc_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate10_11afc_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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 = + } + } +} + diff --git a/fanuc_lrmate10_11afc/runnables/physics/newton.usda b/fanuc_lrmate10_11afc/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..83802f180de4f54b7df7f49d6312f34dd039fc33 --- /dev/null +++ b/fanuc_lrmate10_11afc/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate10_11afc" +) + +over "lrmate10_11afc" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 100 + float newton:damping = 3.333334 + float newton:velocityLimit = 299.99997 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 146.7391 + float newton:damping = 4.891304 + float newton:velocityLimit = 230 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 33.0882 + float newton:damping = 1.102941 + float newton:velocityLimit = 339.99997 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 5.25 + float newton:damping = 0.175 + float newton:velocityLimit = 499.99997 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 5.625 + float newton:damping = 0.1875 + float newton:velocityLimit = 399.99997 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 1.4062 + float newton:damping = 0.046875 + float newton:velocityLimit = 799.99994 + } + } +} + diff --git a/fanuc_lrmate10_11afc/runnables/physics/physx.usda b/fanuc_lrmate10_11afc/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..07950d79d1256a460186ff91b9045562f145006f --- /dev/null +++ b/fanuc_lrmate10_11afc/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate10_11afc" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate10_11afc" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 299.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 339.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 499.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 799.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..a634ac101ac9c469e2618ca7843caa5b83ef18db --- /dev/null +++ b/fanuc_lrmate14_7d/.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:15", + "assets": [ + { + "asset": "lrmate14-7d.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/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..ea7b26c130953d56098a02cb612870ad0c523f47 --- /dev/null +++ b/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate14-7d.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "15342960d49266c4773cff67b0221cca907d2f52e53affc308fb4a7931a2bf88", + "sha256": "4409ccc9eb47a55db5d0b3b1696027965da67f1cbdf8d8b0964c3c3e8d4009f3" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate14-7d.usda.png", + "size": 43573, + "hash": { + "sha256-flat-1mb": "155b5d35917af529bd1274973c6714865d9ff712a5c85f95d50896aea556724d", + "sha256": "41a04345ce47e003e253d8457853965f12e8989ad9f428c665049b90445dbe8d" + } + }, + { + "relative_path": ".thumbs/lrmate14-7d.thumb.usd", + "size": 6127, + "hash": { + "sha256-flat-1mb": "cd3c9fdee9e75948a932b3f944416215bf7659fd4a742c95fcdcac7094c9fc49", + "sha256": "b9489b6b5b4cc60b2ff2f82aa741f00d4414af69cc63c79e5b1e037cb8ed5439" + } + }, + { + "relative_path": "lrmate14-7d.usda", + "size": 16018, + "hash": { + "sha256-flat-1mb": "1d5a3245bb59b09a68db77a447665b94329940ce035f3486a7d5cae952cc3980", + "sha256": "7df02f41e222c6921c61f1190fab47677a0e446c47acd3e170f5aef1cad68145" + } + }, + { + "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": 2919, + "hash": { + "sha256-flat-1mb": "691f3d8701398a997b03354c235b25ea9478489a2e47a4d5d36b0515c25ddeff", + "sha256": "b2c87f1cea5b0c0a862f5afdf5e2767c5f380bb768ace47b90b707ff7b3bc818" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 139, + "hash": { + "sha256-flat-1mb": "5e1859b26de4eb3861aa9f561a26d1273b57fbbb8b2bd3377b38cbde60c99bac", + "sha256": "115e3dc297e040f62e045757be723bf5a9055ddab2c137de74638335fd690cdc" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12069, + "hash": { + "sha256-flat-1mb": "60d5818c34d85a54a0e0da40df130794723fc313d41ff176f6695918cd5d32a2", + "sha256": "1fe8559a8fe939a20ca3d24c16dc3053a35a25d1b24ede0174ddade03e83987e" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1446, + "hash": { + "sha256-flat-1mb": "7de82b00bda3111439a2c5eeb1362228311a8f6e4e0830dadbcf505b2ba200b9", + "sha256": "c6d08ead7f85567687bf27f0d0a093be0d37ae0db3889cb853eabe371a8d138d" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 139, + "hash": { + "sha256-flat-1mb": "5e1859b26de4eb3861aa9f561a26d1273b57fbbb8b2bd3377b38cbde60c99bac", + "sha256": "115e3dc297e040f62e045757be723bf5a9055ddab2c137de74638335fd690cdc" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "7261d62d0dba4b5d3e14cd19bc9956a762d830e2f25a20fe6ad2b354ac4f4c48", + "sha256": "7523ccd948d5f6ca13cb018d8f14b8f49cc90781b5fecfbfa2ab43ee5f5761f1" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11555, + "hash": { + "sha256-flat-1mb": "f9a73ce8ed634d27423ddec789865ea109f5d28486b399d5da0e5b1e197952d6", + "sha256": "4c0cddc1a403bfc2d23e402afa8d4b434c50f3bb84e118900692487730b0ec9c" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 6986116, + "hash": { + "sha256-flat-1mb": "13d27eb09a645e1b9d070650d199339955f1b991aa871400715d282b3ad62537", + "sha256": "34171f45b6c709d8bd8730b75e6a2bcaf432e71f146ac1d15e644ef9762576b8", + "sha256-first1m": "bc4aef1faf0b862f3ac0de9bf6b2c5fa5fb745a698d1e69bbefcaeebb6379194" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 34933, + "hash": { + "sha256-flat-1mb": "f1decee7271142b92c1f256e711ee8a299a0bc0bb99539ed2b45cb859bce7732", + "sha256": "bebacfd8a1c6f32da85d6a261e0acb667ea36dbfe8f815336be27129ebfdd361" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61554, + "hash": { + "sha256-flat-1mb": "0cd52fc80cede7b85dcdd4bb8f91a292f0ffd7a6bb50513d9996a667627c6a0f", + "sha256": "424d723f3e8ca882a07e1878739747fcf5d88383210d8995d5e9a227fde7ac08" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 2977, + "hash": { + "sha256-flat-1mb": "2e5de925fa48237a0042dec9e511f1cef824ea7bdfe9a8eba073357979bfc6df", + "sha256": "83808b8dd6af68dca323aafbc21527170799a94e4f5dfcc4a837af92117c441a" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8190, + "hash": { + "sha256-flat-1mb": "9e305c9bb81f52356544470ea69b08aea942a5ce90c5329e86dec8e5e08942c0", + "sha256": "449b573e3e8a94ab9e90c06b7077ed916c73209a7a404fe2ab948d161dbaa30d" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4911, + "hash": { + "sha256-flat-1mb": "9ebd9882eb51bca9a5c986edab5ce68aa81b015833705414bbed3fac93a86fac", + "sha256": "bac77efb7a003216dc9f0c61f4bd3c0051b2d2887cad9c157385b254afbb977f" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3536, + "hash": { + "sha256-flat-1mb": "521f200e4f8b5cfb5f545f4e95e8c89c00a3e92ba46393e15bd16c3cb4179359", + "sha256": "edac2151c69287b6be2d020ca3f381e270a7e829acee4feab1f55d2597c4a44f" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..f4d7a73eb4834486288803e5ad4f21e405ed26a6 --- /dev/null +++ b/fanuc_lrmate14_7d/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate14-7d.usda" + ] +} diff --git a/fanuc_lrmate14_7d/.metadata/license.txt b/fanuc_lrmate14_7d/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate14_7d/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate14_7d/.simready/validation.json b/fanuc_lrmate14_7d/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate14_7d/.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/fanuc_lrmate14_7d/.thumbs/256x256/.lrmate14-7d.usda.last_generated b/fanuc_lrmate14_7d/.thumbs/256x256/.lrmate14-7d.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..64dacb65bf2eaad200e75597010f6cbccac48fec --- /dev/null +++ b/fanuc_lrmate14_7d/.thumbs/256x256/.lrmate14-7d.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:38 \ No newline at end of file diff --git a/fanuc_lrmate14_7d/.thumbs/256x256/lrmate14-7d.usda.png b/fanuc_lrmate14_7d/.thumbs/256x256/lrmate14-7d.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..f0e6b9686944a8df5eb4fc52d3d746d0e1c8ea67 --- /dev/null +++ b/fanuc_lrmate14_7d/.thumbs/256x256/lrmate14-7d.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41a04345ce47e003e253d8457853965f12e8989ad9f428c665049b90445dbe8d +size 43573 diff --git a/fanuc_lrmate14_7d/.thumbs/lrmate14-7d.thumb.usd b/fanuc_lrmate14_7d/.thumbs/lrmate14-7d.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..fe7f9cd51b3ec353c7c7bf8ca7d22fc9cb44ea36 Binary files /dev/null and b/fanuc_lrmate14_7d/.thumbs/lrmate14-7d.thumb.usd differ diff --git a/fanuc_lrmate14_7d/com.nvidia.simready.packaging.json b/fanuc_lrmate14_7d/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..d43236f5c606fd5e085b356f58b06fd3789b8b0b --- /dev/null +++ b/fanuc_lrmate14_7d/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate14_7d.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "f228a72c6866818c9604c9f22884abc7e8aec43b57498a8491d967f035c5ac48" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "6ab7432a43bf8c91dfa34b41b359c7cabb1b2096df61c323e0af3ad10f9b217a" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "5709257cef2f35776cf4a421f7541fe4098128e6f9e85182271bd9c35eb3bb43" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "fabf27d66299ca49968e321448f26ce8c3de075535593f5a92c2e6cf76cc2861" + }, + "package_hash": { + "sha256": "c23e3ca596dbe6c15ddcd99dd7f1f043648c2b63d1cdd3a58abcd20c2e388864" + } +} diff --git a/fanuc_lrmate14_7d/lrmate14-7d.usda b/fanuc_lrmate14_7d/lrmate14-7d.usda new file mode 100644 index 0000000000000000000000000000000000000000..d21215340d82a8e672d3479816cdbd58e92b7482 --- /dev/null +++ b/fanuc_lrmate14_7d/lrmate14-7d.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate14_7d" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate14_7d" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate14_7d" + 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.6104005, 0.23500204, 0.75890136) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate14-7d" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 24.999400448054075 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate14-7d/lrmate14-7d.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate14_7d" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate14_7d/materials/mdl/LICENSE.md b/fanuc_lrmate14_7d/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/materials/mdl/OmniPBR.mdl b/fanuc_lrmate14_7d/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate14_7d/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate14_7d/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/materials/mdl/aux_definitions.mdl b/fanuc_lrmate14_7d/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/materials/mdl/core_definitions.mdl b/fanuc_lrmate14_7d/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/materials/mdl/support_definitions.mdl b/fanuc_lrmate14_7d/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate14_7d/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/fanuc_lrmate14_7d/payloads/Physics/mujoco.usda b/fanuc_lrmate14_7d/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..e535b6ad0dd7443a98ee4e8bb58a542fbdc42a78 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate14_7d" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate14_7d/payloads/Physics/none.usda b/fanuc_lrmate14_7d/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..86b5a30f923494b5c38efb232b1f11c490868290 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate14_7d" +{ +} + diff --git a/fanuc_lrmate14_7d/payloads/Physics/physics.usda b/fanuc_lrmate14_7d/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..afdf01dedc5c606e12bb6949c6348e110e305b58 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate14_7d" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 700 + float drive:angular:physics:stiffness = 2500 + 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.4797241 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 800 + float drive:angular:physics:stiffness = 2500 + 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.46435744 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 400 + float drive:angular:physics:stiffness = 2500 + 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.9150001 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 204.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 90 + float drive:angular:physics:stiffness = 2500 + 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.26739454 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.08170488 + point3f physics:localPos0 = (0.335, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 2500 + 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.00010597091 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.014599999, -0.000342, 0.0796) + float3 physics:diagonalInertia = (0.0249298, 0.030545464, 0.032224737) + float physics:mass = 5.3 + quatf physics:principalAxes = (0.99753296, 0.044310983, 0.021651091, 0.049957946) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.04423243, 0.030322233, 0.029645337) + float physics:mass = 5.62 + quatf physics:principalAxes = (0.97291726, 0.08880277, 0.21243154, -0.02046823) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00271, -0.000976, 0.159) + float3 physics:diagonalInertia = (0.15900023, 0.13601248, 0.04288727) + float physics:mass = 9.05 + quatf physics:principalAxes = (0.9999827, -0.005799822, -0.0006607653, 0.00069359393) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.005516059, 0.0066524264, 0.007021514) + float physics:mass = 2.15 + quatf physics:principalAxes = (0.9697229, 0.018511126, -0.24127601, 0.03287628) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.223, 0.00356, 0.00215) + float3 physics:diagonalInertia = (0.0039496003, 0.01709073, 0.017109672) + float physics:mass = 2.42 + quatf physics:principalAxes = (0.92588603, 0.3777929, 0.0025477593, -0.0010524341) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0177, 0.0025, -0.00000419) + float3 physics:diagonalInertia = (0.000337672, 0.0006023279, 0.000563) + float physics:mass = 0.446 + quatf physics:principalAxes = (0.9993718, -0.00023707442, -0.000035192767, -0.035440132) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.074, 3.3500002e-18, -4.88e-19) + float3 physics:diagonalInertia = (0.00000275, 0.00000153, 0.00000153) + float physics:mass = 0.0134 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate14_7d/payloads/Physics/physx.usda b/fanuc_lrmate14_7d/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..e1ab8dd29f9e3ca0c115a2fe47bf214e056da4ba --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate14_7d" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 289.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 210.99998 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 240 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate14_7d/payloads/Sensor/none.usda b/fanuc_lrmate14_7d/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..86b5a30f923494b5c38efb232b1f11c490868290 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate14_7d" +{ +} + diff --git a/fanuc_lrmate14_7d/payloads/Sensor/sensors.usda b/fanuc_lrmate14_7d/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..f7f0ddbfbec39906ff3fdd6d1dc88a9e062ad062 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate14_7d" +{ +} + diff --git a/fanuc_lrmate14_7d/payloads/base.usda b/fanuc_lrmate14_7d/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..e8d06fa85d63424cb77dabfcf95e577f99e6a14f --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate14_7d" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6600000262260437) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07999999821186066, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate14_7d/payloads/geometries.usd b/fanuc_lrmate14_7d/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..2ac9718c78a9d9af06e642dc98a131666c983314 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34171f45b6c709d8bd8730b75e6a2bcaf432e71f146ac1d15e644ef9762576b8 +size 6986116 diff --git a/fanuc_lrmate14_7d/payloads/instances.usda b/fanuc_lrmate14_7d/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..d731b8b18dd0e3d33fe80a18d4fe1fac0c613bb4 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/instances.usda @@ -0,0 +1,1006 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.05, 0.05, 0.05) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4980392, 0.4980392, 0.4980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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 = ["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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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 "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7333333, 0.7333333, 0.7333333) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.9333334, 0.9333334, 0.9333334) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_10" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 0.8000001, 0.8000001) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_11" ( + 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_3" ( + 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_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_3" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_lrmate14_7d/payloads/materials.usda b/fanuc_lrmate14_7d/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..9d9f0df3c30774c0c1b99160fdacfbabd4af494d --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/materials.usda @@ -0,0 +1,1761 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.05, 0.05, 0.05) ( + 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:metallic_constant = 0 + 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.05, 0.05, 0.05) + 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_1" + { + 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_1" ( + 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.4980392, 0.4980392, 0.4980392) ( + 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.4980392, 0.4980392, 0.4980392) + 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_2" + { + 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_2" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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" + { + 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_3" + { + 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_0" ( + 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_4" + { + 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_1" ( + 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, 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 = (1, 1, 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_5" + { + 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_0" ( + 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.7333333, 0.7333333, 0.7333333) ( + 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.7333333, 0.7333333, 0.7333333) + 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_7" + { + 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_2" ( + 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.9333334, 0.9333334, 0.9333334) ( + 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.9333334, 0.9333334, 0.9333334) + 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_9" + { + 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_1" ( + 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.8000001, 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.8000001, 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_10" + { + 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_2" ( + 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.8000001, 0.8000001, 0.8000001) ( + 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.8000001, 0.8000001, 0.8000001) + 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_11" + { + 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_1" ( + 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 + } + } +} + diff --git a/fanuc_lrmate14_7d/payloads/robot.usda b/fanuc_lrmate14_7d/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..45b8c04db963f76ea92e20cc6f4a9d829bee5385 --- /dev/null +++ b/fanuc_lrmate14_7d/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate14_7d" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate14_7d/runnables/physics/mujoco.usda b/fanuc_lrmate14_7d/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..c2b18634e338ed4af33c1cbe4b65c074da321142 --- /dev/null +++ b/fanuc_lrmate14_7d/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate14_7d" +) + +def "lrmate14_7d" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate14_7d_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 700 + double mjc:forceRange:min = -700 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate14_7d_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 800 + double mjc:forceRange:min = -800 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate14_7d_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 400 + double mjc:forceRange:min = -400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate14_7d_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate14_7d_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate14_7d_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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 = + } + } +} + diff --git a/fanuc_lrmate14_7d/runnables/physics/newton.usda b/fanuc_lrmate14_7d/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..94a7bb9aed6c895bd069c84206252e3d486e148d --- /dev/null +++ b/fanuc_lrmate14_7d/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate14_7d" +) + +over "lrmate14_7d" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 90.5173 + float newton:damping = 3.017242 + float newton:velocityLimit = 289.99997 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 130.4348 + float newton:damping = 4.347826 + float newton:velocityLimit = 230 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 71.09 + float newton:damping = 2.369668 + float newton:velocityLimit = 210.99998 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 8.4375 + float newton:damping = 0.28125 + float newton:velocityLimit = 399.99997 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 10.9375 + float newton:damping = 0.364583 + float newton:velocityLimit = 240 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.8125 + float newton:damping = 0.09375 + float newton:velocityLimit = 399.99997 + } + } +} + diff --git a/fanuc_lrmate14_7d/runnables/physics/physx.usda b/fanuc_lrmate14_7d/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..234edf43994122e0fef279617d76c86c9fe66146 --- /dev/null +++ b/fanuc_lrmate14_7d/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate14_7d" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate14_7d" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 289.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 210.99998 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 240 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..9ef538c8ada8947074bc8c929e0a2e0f52295913 --- /dev/null +++ b/fanuc_lrmate200id/.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:15", + "assets": [ + { + "asset": "lrmate200id.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/fanuc_lrmate200id/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..3be0aa06307e1082641587cfbddab643f9330827 --- /dev/null +++ b/fanuc_lrmate200id/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "801041873a409f6662a9c067dd07115497da5d05e4aebd25db8de96130e106e3", + "sha256": "e517a344c787468a8caeee7392f52d21f0d46870a2464d30ea883d6a88f4e16f" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id.usda.png", + "size": 43921, + "hash": { + "sha256-flat-1mb": "c4cbd34f965c8e0c052463d14821f48c0af245b5f8a7fa121850c2e62f06ead0", + "sha256": "52cbd90e1cb8a3976a4272c26a606db00d5ff48b388961a884caf69a7c80d51a" + } + }, + { + "relative_path": ".thumbs/lrmate200id.thumb.usd", + "size": 6127, + "hash": { + "sha256-flat-1mb": "eec20d2c88973b3a177f1033bee35fded88ff39e7fd6a14e1d8a1106842b7511", + "sha256": "96e890e25d94781b6d99d3934b9af84a53d4fb594b30f4cc690eb9a3babb4560" + } + }, + { + "relative_path": "lrmate200id.usda", + "size": 16018, + "hash": { + "sha256-flat-1mb": "d19868790263568e5faefe1c6c55739330ab4a73d86ee5431fc3f4f2d00db494", + "sha256": "3b749eb90d261ddc2a67d13628ed8faef8af4a55df4a1a4d2a12018e3e1056d3" + } + }, + { + "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": 2919, + "hash": { + "sha256-flat-1mb": "a6dab95bf038b5d2c6647932c0a91548ffa59724cccc93111305844c04715552", + "sha256": "ad1fa3a3ac969b80b90da6fa51d3a1d709db6deba589230ea5411b7c5053efe7" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 139, + "hash": { + "sha256-flat-1mb": "34c466bdf4b589b0096c2998fb299f1ab5fcd98be8f50e483713c1e190cad5c1", + "sha256": "7077df4bb955ace3f4dcc67cad29effcfaca490964e6dc4241bed4616959f665" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12069, + "hash": { + "sha256-flat-1mb": "1f472423b8c4f86c87813ecdbcd8466496f3e73e4c738c5242cb452b015f6ab1", + "sha256": "11b60d1207af5da25e5a703d5c07e62123f9af280a9ea0ebc637dc960399def9" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1446, + "hash": { + "sha256-flat-1mb": "eab8b5bd55771f62096ad9c35a3305699c2e09b271fca02bea368099a1522e68", + "sha256": "aa440a0c987f8f533416cef3b3ac9bc3cc80fbf902ac284b1c1c8e3cdf1d3dbb" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 139, + "hash": { + "sha256-flat-1mb": "34c466bdf4b589b0096c2998fb299f1ab5fcd98be8f50e483713c1e190cad5c1", + "sha256": "7077df4bb955ace3f4dcc67cad29effcfaca490964e6dc4241bed4616959f665" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "1dbcf4319e2325ec2cee14b4e3c2ff034eaa87d4142ea60205c42d8f5d3b5f10", + "sha256": "0abeef8d081a4f40456879bfb63b7fffd1977cd58e178c1cfa725e39fbfcaf73" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11555, + "hash": { + "sha256-flat-1mb": "287db76374946477ba79fff1da31c2c21d3314d028e5aaccb08b5fb5d69c5cf6", + "sha256": "b52dbe66fd6fd6b373fc469dcb0c053847f1f1eb91ca5bcc3a074615f944c9f6" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 6986116, + "hash": { + "sha256-flat-1mb": "ce25668626ca73c2daee7071214fad9a9857f1aeb8d773c5bdfa4a33e8d668f4", + "sha256": "fad2a07212a2a22036c62fff02a8c2f1def4517f6e1272688ac349f3ff97befb", + "sha256-first1m": "bc4aef1faf0b862f3ac0de9bf6b2c5fa5fb745a698d1e69bbefcaeebb6379194" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 34933, + "hash": { + "sha256-flat-1mb": "f1decee7271142b92c1f256e711ee8a299a0bc0bb99539ed2b45cb859bce7732", + "sha256": "bebacfd8a1c6f32da85d6a261e0acb667ea36dbfe8f815336be27129ebfdd361" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61507, + "hash": { + "sha256-flat-1mb": "dce713a4c5ad9872eeb763ba5e42c4871ea1ae503cad299a4a76dff6777650cc", + "sha256": "3ad7b26c3e9782cd104bb9599a9912c9b84781addc5d53cc58fae4ace605fa66" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 2977, + "hash": { + "sha256-flat-1mb": "d715678ef70d82d49217a35dc64bbab41bd32996cda6614c21e767756b385c4e", + "sha256": "92cdb24e9ea96df759f60f12ac9460212e9c75095ffbf656e2885e66b601d39e" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8190, + "hash": { + "sha256-flat-1mb": "e23f85ba133dbb87b6cb653bd3c77d6b4513f2136d2f35958d635c11e71905ab", + "sha256": "88114c4d32b6bf53b62c18061009cb7a2ec4a3e674bf7de3e4e05898ab413e01" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4908, + "hash": { + "sha256-flat-1mb": "845303e1783d997b5c9e1da0c3220d1f3c1b9cffc9e7108f13101114aad8776c", + "sha256": "437ed55334bcd678e67aa2c615d3e3e6885ae1535709095ae2bc901b32a983d9" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3536, + "hash": { + "sha256-flat-1mb": "f703e637d5335f1c4102cc5595ec3f118fc16cdc93c604f0f89cd7e9704101ea", + "sha256": "16882130ef701b43a4664771dd1b2245428cde2c9569427b2737e16130abe816" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..0f76fcc971ab69c4d2aedb0d2fbf9a370880cd88 --- /dev/null +++ b/fanuc_lrmate200id/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id.usda" + ] +} diff --git a/fanuc_lrmate200id/.metadata/license.txt b/fanuc_lrmate200id/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id/.simready/validation.json b/fanuc_lrmate200id/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id/.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/fanuc_lrmate200id/.thumbs/256x256/.lrmate200id.usda.last_generated b/fanuc_lrmate200id/.thumbs/256x256/.lrmate200id.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..3818fd004257e68401b5f6c379c3e6645ec76a72 --- /dev/null +++ b/fanuc_lrmate200id/.thumbs/256x256/.lrmate200id.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:42 \ No newline at end of file diff --git a/fanuc_lrmate200id/.thumbs/256x256/lrmate200id.usda.png b/fanuc_lrmate200id/.thumbs/256x256/lrmate200id.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..e5c80c19b1e97411c520f5d0b70a8e5294052a4e --- /dev/null +++ b/fanuc_lrmate200id/.thumbs/256x256/lrmate200id.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52cbd90e1cb8a3976a4272c26a606db00d5ff48b388961a884caf69a7c80d51a +size 43921 diff --git a/fanuc_lrmate200id/.thumbs/lrmate200id.thumb.usd b/fanuc_lrmate200id/.thumbs/lrmate200id.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..2d7964fcdcba516f0ae9a688590edecb9deda734 Binary files /dev/null and b/fanuc_lrmate200id/.thumbs/lrmate200id.thumb.usd differ diff --git a/fanuc_lrmate200id/com.nvidia.simready.packaging.json b/fanuc_lrmate200id/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..3166b04ceef19e05533a09df8640a3f01ff79774 --- /dev/null +++ b/fanuc_lrmate200id/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "84c55adfc9d82b07021086d65dfc45bf8c81262914f9f326d294026961ac3fb8" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "b48f26ad323dafd94783f472f77e341312782231e6191f0dda3f3aa8f7cb02cc" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "a6f2118061ceb398f33892d267e663194de31139aabfd32d9a5b441aeb7f0e81" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "680064b1ce33000e053486cc38fb5b09427c38587ba07a6cf4ffb50e7baf7159" + }, + "package_hash": { + "sha256": "4e791fbb5113b18fddd01a49153ed82e3fb114cc4b7f77ae39332219f375cc6c" + } +} diff --git a/fanuc_lrmate200id/lrmate200id.usda b/fanuc_lrmate200id/lrmate200id.usda new file mode 100644 index 0000000000000000000000000000000000000000..a72552664c43a6725a271f8a278a000b45137c64 --- /dev/null +++ b/fanuc_lrmate200id/lrmate200id.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id" + 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.6104005, 0.23500204, 0.75890136) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 24.999400448054075 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id/lrmate200id.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id/materials/mdl/LICENSE.md b/fanuc_lrmate200id/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id/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/fanuc_lrmate200id/payloads/Physics/mujoco.usda b/fanuc_lrmate200id/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..93721319561c0d7940a487d6df9f81f43ce82e7e --- /dev/null +++ b/fanuc_lrmate200id/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id/payloads/Physics/none.usda b/fanuc_lrmate200id/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c7aaf27a05dcd5a3b43f427c541793446ce2c568 --- /dev/null +++ b/fanuc_lrmate200id/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id" +{ +} + diff --git a/fanuc_lrmate200id/payloads/Physics/physics.usda b/fanuc_lrmate200id/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..f09902120e97557a8b21cfc257b02ff2d1392f61 --- /dev/null +++ b/fanuc_lrmate200id/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 500 + float drive:angular:physics:stiffness = 2500 + 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.4797241 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 500 + float drive:angular:physics:stiffness = 2500 + 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.46435744 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 2500 + 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.9150001 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 204.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.26739454 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 40 + float drive:angular:physics:stiffness = 2500 + 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.08170488 + point3f physics:localPos0 = (0.335, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.00010597091 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.014599999, -0.000342, 0.0796) + float3 physics:diagonalInertia = (0.0249298, 0.030545464, 0.032224737) + float physics:mass = 5.3 + quatf physics:principalAxes = (0.99753296, 0.044310983, 0.021651091, 0.049957946) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.04423243, 0.030322233, 0.029645337) + float physics:mass = 5.62 + quatf physics:principalAxes = (0.97291726, 0.08880277, 0.21243154, -0.02046823) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00271, -0.000976, 0.159) + float3 physics:diagonalInertia = (0.15900023, 0.13601248, 0.04288727) + float physics:mass = 9.05 + quatf physics:principalAxes = (0.9999827, -0.005799822, -0.0006607653, 0.00069359393) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.005516059, 0.0066524264, 0.007021514) + float physics:mass = 2.15 + quatf physics:principalAxes = (0.9697229, 0.018511126, -0.24127601, 0.03287628) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.223, 0.00356, 0.00215) + float3 physics:diagonalInertia = (0.0039496003, 0.01709073, 0.017109672) + float physics:mass = 2.42 + quatf physics:principalAxes = (0.92588603, 0.3777929, 0.0025477593, -0.0010524341) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0177, 0.0025, -0.00000419) + float3 physics:diagonalInertia = (0.000337672, 0.0006023279, 0.000563) + float physics:mass = 0.446 + quatf physics:principalAxes = (0.9993718, -0.00023707442, -0.000035192767, -0.035440132) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.074, 3.3500002e-18, -4.88e-19) + float3 physics:diagonalInertia = (0.00000275, 0.00000153, 0.00000153) + float physics:mass = 0.0134 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id/payloads/Physics/physx.usda b/fanuc_lrmate200id/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..b849e225e12077540f1732bd72a63d59a6e141c6 --- /dev/null +++ b/fanuc_lrmate200id/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 380 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id/payloads/Sensor/none.usda b/fanuc_lrmate200id/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..c7aaf27a05dcd5a3b43f427c541793446ce2c568 --- /dev/null +++ b/fanuc_lrmate200id/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id" +{ +} + diff --git a/fanuc_lrmate200id/payloads/Sensor/sensors.usda b/fanuc_lrmate200id/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..6d87aad7f2e07f247ee39d26f7abcae66b768616 --- /dev/null +++ b/fanuc_lrmate200id/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id" +{ +} + diff --git a/fanuc_lrmate200id/payloads/base.usda b/fanuc_lrmate200id/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..1fad98eb4acc3ead73df72dc81f7e11573693407 --- /dev/null +++ b/fanuc_lrmate200id/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6600000262260437) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07999999821186066, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id/payloads/geometries.usd b/fanuc_lrmate200id/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..f4766d1cb59ae768a8fdf8e5cda8a28ab0601540 --- /dev/null +++ b/fanuc_lrmate200id/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fad2a07212a2a22036c62fff02a8c2f1def4517f6e1272688ac349f3ff97befb +size 6986116 diff --git a/fanuc_lrmate200id/payloads/instances.usda b/fanuc_lrmate200id/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..d731b8b18dd0e3d33fe80a18d4fe1fac0c613bb4 --- /dev/null +++ b/fanuc_lrmate200id/payloads/instances.usda @@ -0,0 +1,1006 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.05, 0.05, 0.05) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4980392, 0.4980392, 0.4980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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 = ["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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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 "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7333333, 0.7333333, 0.7333333) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.9333334, 0.9333334, 0.9333334) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_10" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 0.8000001, 0.8000001) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_11" ( + 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_3" ( + 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_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_3" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_lrmate200id/payloads/materials.usda b/fanuc_lrmate200id/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..507027d2312690a30687f01a81fb04a49c879e11 --- /dev/null +++ b/fanuc_lrmate200id/payloads/materials.usda @@ -0,0 +1,1760 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.05, 0.05, 0.05) ( + 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.05, 0.05, 0.05) + 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_1" + { + 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_1" ( + 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.4980392, 0.4980392, 0.4980392) ( + 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.4980392, 0.4980392, 0.4980392) + 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_2" + { + 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_2" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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" + { + 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_3" + { + 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_0" ( + 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_4" + { + 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_1" ( + 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, 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 = (1, 1, 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_5" + { + 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_0" ( + 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.7333333, 0.7333333, 0.7333333) ( + 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.7333333, 0.7333333, 0.7333333) + 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_7" + { + 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_2" ( + 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.9333334, 0.9333334, 0.9333334) ( + 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.9333334, 0.9333334, 0.9333334) + 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_9" + { + 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_1" ( + 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.8000001, 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.8000001, 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_10" + { + 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_2" ( + 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.8000001, 0.8000001, 0.8000001) ( + 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.8000001, 0.8000001, 0.8000001) + 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_11" + { + 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_1" ( + 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 + } + } +} + diff --git a/fanuc_lrmate200id/payloads/robot.usda b/fanuc_lrmate200id/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..2165221c09a591446f6688259911f38f1cc6b597 --- /dev/null +++ b/fanuc_lrmate200id/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id/runnables/physics/mujoco.usda b/fanuc_lrmate200id/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..59abab4bd25eeb187f52e969f9b94bff5e86ac1b --- /dev/null +++ b/fanuc_lrmate200id/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id" +) + +def "lrmate200id" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 500 + double mjc:forceRange:min = -500 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 500 + double mjc:forceRange:min = -500 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 40 + double mjc:forceRange:min = -40 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_lrmate200id/runnables/physics/newton.usda b/fanuc_lrmate200id/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..ecdac157ffa38c2626095de2849098b74c5e8cbb --- /dev/null +++ b/fanuc_lrmate200id/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id" +) + +over "lrmate200id" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 41.6667 + float newton:damping = 1.388889 + float newton:velocityLimit = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 49.3421 + float newton:damping = 1.644737 + float newton:velocityLimit = 380 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 14.4231 + float newton:damping = 0.480769 + float newton:velocityLimit = 520 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.7727 + float newton:damping = 0.159091 + float newton:velocityLimit = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.7523 + float newton:damping = 0.091743 + float newton:velocityLimit = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.75 + float newton:damping = 0.025 + float newton:velocityLimit = 999.99994 + } + } +} + diff --git a/fanuc_lrmate200id/runnables/physics/physx.usda b/fanuc_lrmate200id/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..fd1fa8f5f10d678be7ae03abdcdc58b4e4c3c44a --- /dev/null +++ b/fanuc_lrmate200id/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 380 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..1dd6d92c9f4ee8a44e1103f4df094a8fa09c64ce --- /dev/null +++ b/fanuc_lrmate200id14l/.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:15", + "assets": [ + { + "asset": "lrmate200id14l.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/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..02c090a0b24e69910ee6aaeb57c3c757719b2d4e --- /dev/null +++ b/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id14l.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "9f54775c2bde00862ce9de9dcc9ba9943ceca6a85fc668cff7c434df3989c244", + "sha256": "20901462876e46dcba6f61942754781ff9722949fa3859ee1a8c7c1951cecca5" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id14l.usda.png", + "size": 42381, + "hash": { + "sha256-flat-1mb": "0fb66a556d6a93d6a6b9cd359da6f7215f94fd912e5cb1cb7eaf94e7eeb48543", + "sha256": "cecd9ce3817cdf9443ae89fc1c9ba3e1004b1c8d6fea781e05af705e019812e4" + } + }, + { + "relative_path": ".thumbs/lrmate200id14l.thumb.usd", + "size": 6130, + "hash": { + "sha256-flat-1mb": "a0b278da9b6a4559d8d58f559d4f8eab9aaf584c969f559788082d635ff53fa2", + "sha256": "09ac893dc9ac67284ae5d2887f79a9f760db2d58a030a3530e286e58a080c8f3" + } + }, + { + "relative_path": "lrmate200id14l.usda", + "size": 16041, + "hash": { + "sha256-flat-1mb": "c7399994e80b69451c30d9afefb2c1e0f180f91128d7d51e1355ffe4707e95f8", + "sha256": "631b6354b9aea069a466b1889fd1fcaf1c765f504eca959c123649e21a12b002" + } + }, + { + "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": 2922, + "hash": { + "sha256-flat-1mb": "e831541b622710b5d6f4d18b3bcb7fcaca8385bc98a36b74a1b475d1fd6c759d", + "sha256": "df2a3ad515d25d75f54b21cc004b258f24e26c58428727289d1ee5b584de8a38" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "0f8dcd6766d055167777d60e880412da913308c7b5cd81c6973ebd175f4784b0", + "sha256": "631c6fd8a3eade7adb0eea0c55955bd04700f1ccc60d02d976ba0193c8fdac13" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12109, + "hash": { + "sha256-flat-1mb": "5014878d427ab2e1e103af214c41198daea357a86fabe427cced2d194984a2d7", + "sha256": "06b7cf11fdd855dd4e3c1a5b2cd1895a9fb11c597a5dd7033e236996f4aafffe" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1446, + "hash": { + "sha256-flat-1mb": "976db9cd6d2340d0472a485712ad70cac1752f75ec29ff6cd41128faee310804", + "sha256": "c63d28a022d948989472b2343c5102a8d5dbca187f662b0c32ca5ac250d78a3d" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "0f8dcd6766d055167777d60e880412da913308c7b5cd81c6973ebd175f4784b0", + "sha256": "631c6fd8a3eade7adb0eea0c55955bd04700f1ccc60d02d976ba0193c8fdac13" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 151, + "hash": { + "sha256-flat-1mb": "c50b79818ba9adf920652ed69cb21f4116e354558eeaeae67e99a353303bfc3b", + "sha256": "b884f32d712ca17c4f186e79341f2457eead5a3d4815ccf13cf294b9d807ab74" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11561, + "hash": { + "sha256-flat-1mb": "f5bb88d9aac8b5a83117a0d6ef7b9a78849b9e6515ca495d2cce9ba661c3bbe9", + "sha256": "6bdc7d8f58179de9b8fd09dd2b6d5c50be3f73ab51bf99c584c55495e80b0c4d" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 6741080, + "hash": { + "sha256-flat-1mb": "d6727dc04df2eaebbf738cefc1d18361209e5170ace166f13e2766900adf76b3", + "sha256": "2336da6b37de01bca3d2a36fe6f26369d8f740bc642f6de7cd46844dcb214834", + "sha256-first1m": "4087fca33af3f8c6be79f683149b608b70e25798ee2d921ecab8d022290c450e" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 38596, + "hash": { + "sha256-flat-1mb": "5764471c0b5d95bfd6cb086d820de4ddffb0a837faff1789980d76a6868c87a7", + "sha256": "075f7913d45af6cfe2db5299fbd0641268dac8d454b8e502767c329101b3f492" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61507, + "hash": { + "sha256-flat-1mb": "9e05ea5dd7532479bb23f6213472318e039ee8fa7c7c181ea83b660850e13fac", + "sha256": "2ef2bc8561dd0c52114872236700f138cdff39eaa58457c835eaa626a0f8186f" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3025, + "hash": { + "sha256-flat-1mb": "ffede2b70aa38568a5d87770d31ffcb2228d20890d89a2fed6c563224daaa33a", + "sha256": "1bc6bbb1d72a9a305ea39591f42264327e3e18f8915c407a0a4dc0fe1d916e0e" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8232, + "hash": { + "sha256-flat-1mb": "ae1b4e31d6774a581b1245d1f02cf24a6246471b0bc70f6fac4aab93a419abb0", + "sha256": "09e6102d5ae3f3c726a0a20f2fd77cf9d496c750070f526647e844c61d7f1e55" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4912, + "hash": { + "sha256-flat-1mb": "10dca99a37531bf8946f65bd79df70e452729ca0b89982227f74bcd92d1d92a0", + "sha256": "3469b134f7a4107e72a53eb51d52f4d9e930eccb7f8e031dbd1cc59ca7dabbf5" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3536, + "hash": { + "sha256-flat-1mb": "3f835d1a936874fd89a763602bc044b2f9e90abb3c1d0978ad5aa03b59b674e4", + "sha256": "dbbb6bb9ede20ee8ca029f215b60eb35143e64fc41e12dd791b3ed2ad0de4f0f" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..ccc3a3f8eb10ab43ffc7979186588cbcb9fd523c --- /dev/null +++ b/fanuc_lrmate200id14l/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id14l.usda" + ] +} diff --git a/fanuc_lrmate200id14l/.metadata/license.txt b/fanuc_lrmate200id14l/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id14l/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id14l/.simready/validation.json b/fanuc_lrmate200id14l/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id14l/.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/fanuc_lrmate200id14l/.thumbs/256x256/.lrmate200id14l.usda.last_generated b/fanuc_lrmate200id14l/.thumbs/256x256/.lrmate200id14l.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..e398ac232383450570b536077649cfc4d22ca4e2 --- /dev/null +++ b/fanuc_lrmate200id14l/.thumbs/256x256/.lrmate200id14l.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:46 \ No newline at end of file diff --git a/fanuc_lrmate200id14l/.thumbs/256x256/lrmate200id14l.usda.png b/fanuc_lrmate200id14l/.thumbs/256x256/lrmate200id14l.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..c6024d22fac632fc1f2b568bfd26c16259d942be --- /dev/null +++ b/fanuc_lrmate200id14l/.thumbs/256x256/lrmate200id14l.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cecd9ce3817cdf9443ae89fc1c9ba3e1004b1c8d6fea781e05af705e019812e4 +size 42381 diff --git a/fanuc_lrmate200id14l/.thumbs/lrmate200id14l.thumb.usd b/fanuc_lrmate200id14l/.thumbs/lrmate200id14l.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..03ed45f535f3596788aea96bd9777b8e7f83e849 Binary files /dev/null and b/fanuc_lrmate200id14l/.thumbs/lrmate200id14l.thumb.usd differ diff --git a/fanuc_lrmate200id14l/com.nvidia.simready.packaging.json b/fanuc_lrmate200id14l/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..82f5a9deb94e80226c1d6d1b3de2aa1a9eacf2ce --- /dev/null +++ b/fanuc_lrmate200id14l/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id14l.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "22681d4df3836b1d7ec2c9a694149533ab9f7ca89a17bf59e2049595de67fe79" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "dd5d7adc1aaf3638f926e15bc2a8b68ce85f3029c31e3e9c12021277b6e2c154" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "16c7c6e15ff2b9fe4a15c2bca6be454c2e6da6e82cf179540886dcec702a5347" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "da347fc1417115bcc8581d0207f2c4a4e24101b9a0dc308e182b64b54d7e7bf2" + }, + "package_hash": { + "sha256": "8404baa553dc75084b66f085c89bddb0a81db5fd4219b510fb21f89c74a6d4d4" + } +} diff --git a/fanuc_lrmate200id14l/lrmate200id14l.usda b/fanuc_lrmate200id14l/lrmate200id14l.usda new file mode 100644 index 0000000000000000000000000000000000000000..735996bcbb19aaa0685e42e6550c8b7af13b6ef4 --- /dev/null +++ b/fanuc_lrmate200id14l/lrmate200id14l.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id14l" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id14l" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id14l" + 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.6954005, 0.23500204, 0.8689013) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id14l" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 26.980899488553405 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id14l/lrmate200id14l.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id14l" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id14l/materials/mdl/LICENSE.md b/fanuc_lrmate200id14l/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id14l/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id14l/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id14l/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id14l/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id14l/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id14l/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id14l/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/fanuc_lrmate200id14l/payloads/Physics/mujoco.usda b/fanuc_lrmate200id14l/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..4e79a27e5cf09fe997313c054d18904a46541715 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id14l" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id14l/payloads/Physics/none.usda b/fanuc_lrmate200id14l/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..5fbaedc598292dff9ea6befc96745866a7c1e1f1 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id14l" +{ +} + diff --git a/fanuc_lrmate200id14l/payloads/Physics/physics.usda b/fanuc_lrmate200id14l/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..67c316c823c0f9736ae8c9a7bba3132b5ae93f30 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id14l" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 700 + float drive:angular:physics:stiffness = 2500 + 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.47102547 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 800 + float drive:angular:physics:stiffness = 2500 + 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.50967014 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 400 + float drive:angular:physics:stiffness = 2500 + 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 = 1.6201171 + point3f physics:localPos0 = (0, 0, 0.44) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 212.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 90 + float drive:angular:physics:stiffness = 2500 + 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.45439643 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.1201405 + point3f physics:localPos0 = (0.42, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 2500 + 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.00010202705 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0146, -0.00034199998, 0.0796) + float3 physics:diagonalInertia = (0.02403238, 0.02944247, 0.030925151) + float physics:mass = 5.09 + quatf physics:principalAxes = (0.9973477, 0.048264433, 0.02222265, 0.049742773) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.04253522, 0.029123956, 0.028540822) + float physics:mass = 5.41 + quatf physics:principalAxes = (0.97182727, 0.099421754, 0.21247762, -0.022811107) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00311, -0.00124, 0.217) + float3 physics:diagonalInertia = (0.28000227, 0.25501862, 0.051079098) + float physics:mass = 10.9 + quatf physics:principalAxes = (0.9999872, -0.0047821454, -0.0015663651, 0.0005184825) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.00529951, 0.00640227, 0.006748221) + float physics:mass = 2.07 + quatf physics:principalAxes = (0.9697991, 0.019287033, -0.24092257, 0.032774962) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.266, 0.00354, 0.00226) + float3 physics:diagonalInertia = (0.0051099635, 0.034700915, 0.034599118) + float physics:mass = 3.07 + quatf physics:principalAxes = (0.9988725, -0.047469597, 0.0005209576, 0.00018055725) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0177, 0.0025, -0.00000419) + float3 physics:diagonalInertia = (0.0003247349, 0.000579265, 0.000542) + float physics:mass = 0.428 + quatf physics:principalAxes = (0.9993777, -0.00024123333, -0.00003497771, -0.035272483) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.074, 3.35e-18, -4.88e-19) + float3 physics:diagonalInertia = (0.00000264, 0.00000148, 0.00000148) + float physics:mass = 0.0129 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id14l/payloads/Physics/physx.usda b/fanuc_lrmate200id14l/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..538e08481ad8af50796f634fe39fec97b3024c62 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id14l" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 120 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 204.99998 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 240 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id14l/payloads/Sensor/none.usda b/fanuc_lrmate200id14l/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..5fbaedc598292dff9ea6befc96745866a7c1e1f1 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id14l" +{ +} + diff --git a/fanuc_lrmate200id14l/payloads/Sensor/sensors.usda b/fanuc_lrmate200id14l/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..cd026855e42f07e65214896000e943be47763fab --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id14l" +{ +} + diff --git a/fanuc_lrmate200id14l/payloads/base.usda b/fanuc_lrmate200id14l/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..fe584917b97724774454212016071d3ff7fe6247 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id14l" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.7699999809265137) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.4699999988079071, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.4699999988079071, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07999999821186066, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id14l/payloads/geometries.usd b/fanuc_lrmate200id14l/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..b7d930c1ef853fc748029a0d2ed75b1a5a0a39a8 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2336da6b37de01bca3d2a36fe6f26369d8f740bc642f6de7cd46844dcb214834 +size 6741080 diff --git a/fanuc_lrmate200id14l/payloads/instances.usda b/fanuc_lrmate200id14l/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..acf837afd5f72b49fc8f8833dd9abc9193f3e58d --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/instances.usda @@ -0,0 +1,1105 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.05, 0.05, 0.05) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4980392, 0.4980392, 0.4980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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 = ["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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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 "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7333333, 0.7333333, 0.7333333) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.9333334, 0.9333334, 0.9333334) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_10" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 0.8000001, 0.8000001) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_11" ( + 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_3" ( + 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_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_3" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_lrmate200id14l/payloads/materials.usda b/fanuc_lrmate200id14l/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..1b8e574493e87b1317c4b51d8c0d7e2e232fb4e2 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/materials.usda @@ -0,0 +1,1760 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.05, 0.05, 0.05) ( + 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.05, 0.05, 0.05) + 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_1" + { + 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_1" ( + 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.4980392, 0.4980392, 0.4980392) ( + 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.4980392, 0.4980392, 0.4980392) + 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_2" + { + 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_2" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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" + { + 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_3" + { + 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_0" ( + 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_4" + { + 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_1" ( + 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, 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 = (1, 1, 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_5" + { + 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_0" ( + 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.7333333, 0.7333333, 0.7333333) ( + 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.7333333, 0.7333333, 0.7333333) + 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_7" + { + 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_2" ( + 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.9333334, 0.9333334, 0.9333334) ( + 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.9333334, 0.9333334, 0.9333334) + 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_9" + { + 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_2" ( + 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.8000001, 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.8000001, 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_10" + { + 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_3" ( + 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.8000001, 0.8000001, 0.8000001) ( + 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.8000001, 0.8000001, 0.8000001) + 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_11" + { + 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_1" ( + 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 + } + } +} + diff --git a/fanuc_lrmate200id14l/payloads/robot.usda b/fanuc_lrmate200id14l/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..508eaf3f1c7e4cd609ec7d210722b7267067e745 --- /dev/null +++ b/fanuc_lrmate200id14l/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id14l" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id14l/runnables/physics/mujoco.usda b/fanuc_lrmate200id14l/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..212b05887cfb01e4842a351e6d801b36933a6fd1 --- /dev/null +++ b/fanuc_lrmate200id14l/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id14l" +) + +def "lrmate200id14l" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id14l_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 700 + double mjc:forceRange:min = -700 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id14l_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 800 + double mjc:forceRange:min = -800 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id14l_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 400 + double mjc:forceRange:min = -400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id14l_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id14l_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id14l_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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 = + } + } +} + diff --git a/fanuc_lrmate200id14l/runnables/physics/newton.usda b/fanuc_lrmate200id14l/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..d8a798492d7161ac4922a6e14e5c95b1e60f7212 --- /dev/null +++ b/fanuc_lrmate200id14l/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id14l" +) + +over "lrmate200id14l" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 218.75 + float newton:damping = 7.291667 + float newton:velocityLimit = 120 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 130.4348 + float newton:damping = 4.347826 + float newton:velocityLimit = 230 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 73.1707 + float newton:damping = 2.439025 + float newton:velocityLimit = 204.99998 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 8.4375 + float newton:damping = 0.28125 + float newton:velocityLimit = 399.99997 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 10.9375 + float newton:damping = 0.364583 + float newton:velocityLimit = 240 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.8125 + float newton:damping = 0.09375 + float newton:velocityLimit = 399.99997 + } + } +} + diff --git a/fanuc_lrmate200id14l/runnables/physics/physx.usda b/fanuc_lrmate200id14l/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..218c970ab5a3cba17b6cef4d0fd072b9658d400d --- /dev/null +++ b/fanuc_lrmate200id14l/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id14l" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id14l" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 120 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 230 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 204.99998 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 240 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 399.99997 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..60af193d70bd3fe0bc09b68ab58ebe2de5366c70 --- /dev/null +++ b/fanuc_lrmate200id4s/.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:16", + "assets": [ + { + "asset": "lrmate200id4s.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/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..434bcff06263d6910f28785b9d0d880ec891f73d --- /dev/null +++ b/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id4s.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "e6a45280e63aec22a6c486b58578003a7d3b7c35aaa5bb0df90235b3cc28485d", + "sha256": "380f69032532f8c3799808b3ae733f19eb54c0bf9d46226219805ac1e7db3352" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id4s.usda.png", + "size": 43197, + "hash": { + "sha256-flat-1mb": "98f732932d47c3d3fb947cae5bc95a9c52660af93d983fd74153d5b46b649adf", + "sha256": "5987ad69ec579b8f0ba1e559f5086f3d4ca02b168c9303af12af7a9570b9c744" + } + }, + { + "relative_path": ".thumbs/lrmate200id4s.thumb.usd", + "size": 6129, + "hash": { + "sha256-flat-1mb": "3e64a3d54e6cf6dcdb523b04f85eacb9d25b3ab0ff86a22e237173f1992d9639", + "sha256": "a6ce0b6482e0d4d5cfe5b0252767b995872486dedabeb2b81dc62ac58e12cccb" + } + }, + { + "relative_path": "lrmate200id4s.usda", + "size": 16033, + "hash": { + "sha256-flat-1mb": "83b9890ac8e432bfee6620f201cee1c478cb1a7a52959325d05fceeba93fc89c", + "sha256": "a1bd621909bafbfb8e482cab8fcbcad523fbc04dba9516a0600f3bc5643edbb6" + } + }, + { + "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": 2921, + "hash": { + "sha256-flat-1mb": "452fc679dc6fc25a593ad621956da3012a7a0bc30bb086a65123c20c9b4cc513", + "sha256": "78e89ee12904d8a3aa25aa732ce282e9af4ec6198a6d106d29f7ac07cb388c95" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 143, + "hash": { + "sha256-flat-1mb": "f7ce9fe9e3a3ea68bff5ad4adeac755ff2a304536c492bbce47d6c87ac8cd841", + "sha256": "488bba2a21c329e10b3cf32ae000417a7b549facf906e32b29ebe1b2313c9bd9" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12091, + "hash": { + "sha256-flat-1mb": "32c82811e89857bfd71e03356bb542446625a784c006f736dc5bf8b785d556ce", + "sha256": "c8988bed2fea878b84d88c39f6076a2354e1895381cc773e5f638ce1121637fa" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1444, + "hash": { + "sha256-flat-1mb": "fd6bc88949d010853ead3e53212756dcdc76248e107a8a8d7ab546f258adff44", + "sha256": "ac2aff5189ae0f0ea8b0983b210c09659efaa2abae003ec85c7dbee081dfd5c1" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 143, + "hash": { + "sha256-flat-1mb": "f7ce9fe9e3a3ea68bff5ad4adeac755ff2a304536c492bbce47d6c87ac8cd841", + "sha256": "488bba2a21c329e10b3cf32ae000417a7b549facf906e32b29ebe1b2313c9bd9" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 149, + "hash": { + "sha256-flat-1mb": "52aa8092db4793f4a60c4344b61bce3cdec59a146a923472706525f5eff0dc84", + "sha256": "1f6409769561ffea613bd409d993012c23c75409f492dbf72eaf95336abeeb2f" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11507, + "hash": { + "sha256-flat-1mb": "49dbe5c968c88d27a25a4b5f0463c2bae6f00bc4988c83ecfa915adc5a667576", + "sha256": "af57aca9ca3e61d50f4bd9e031405ab88574fe6f544c0d597a45aee15ffd7379" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 7323365, + "hash": { + "sha256-flat-1mb": "f0761d68897110a6598d3c0c17573bf2633c0b22739746dc5f43dbe85556224b", + "sha256": "06759cf2812669b01743edc9e4b49a23b03c1d0f8efd5e6125916ec7dcc9642c", + "sha256-first1m": "a4975662e360e04683d22a645734b865ce4fc2c10131974fa2b00d9f21ac7d57" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 40992, + "hash": { + "sha256-flat-1mb": "ff876a8f64276a92c0e48c0969f88ebb10290f415295dbbcd1448e83d0b958e7", + "sha256": "dd93d5322897931d897ce4f5886df20a3966a80727f138a70c9f2d6f6759bdc3" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61345, + "hash": { + "sha256-flat-1mb": "32d2774ee8a6eaee8d6773f8c2dc04234bffd8d9e587b4ce05e9a184ffb3009f", + "sha256": "b5c4146b244db6a872f6e4d9ad7be04cd9fa10398263c3d06a6d4cdb661a0737" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3009, + "hash": { + "sha256-flat-1mb": "872a0bddf7ead7b724d66cfed660e1f7a4c2c7230134aefa18317e7105b993e5", + "sha256": "96a19b2652cc606822bdab0d740fe8fb9db229fce6d2f19096ee23c48066cb77" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8218, + "hash": { + "sha256-flat-1mb": "2559ade257efbce26653f34ae14196cb5936f67739b8ce3c76d3ed4684dd8281", + "sha256": "97a0ed894896d9656a721a4ab6f3b525079cbb504f8d3ca45e168b4b1f83ccd9" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4911, + "hash": { + "sha256-flat-1mb": "1f05c8293b69ef0678bcc61745272221915205c29489f06eccb2e43009a0b1f5", + "sha256": "2f5fbc4865180b57fc2ead4160a4e7a6650858dd9983ddb4b5e43780f928dd44" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3534, + "hash": { + "sha256-flat-1mb": "c02b0b0245bdfad6924768f84fd86f70ff6fc8d9705843b3649576242effc1c0", + "sha256": "5dcf9fa4f962ad152ee19a5f5a4ed332e25d23906cccc28a056011a327eb5df7" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..060d54404807a0688e9b6f5cfdad087909ee73a5 --- /dev/null +++ b/fanuc_lrmate200id4s/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id4s.usda" + ] +} diff --git a/fanuc_lrmate200id4s/.metadata/license.txt b/fanuc_lrmate200id4s/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id4s/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id4s/.simready/validation.json b/fanuc_lrmate200id4s/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id4s/.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/fanuc_lrmate200id4s/.thumbs/256x256/.lrmate200id4s.usda.last_generated b/fanuc_lrmate200id4s/.thumbs/256x256/.lrmate200id4s.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..0014598641ae2b1ae63843ab2ef783a1b71abf5d --- /dev/null +++ b/fanuc_lrmate200id4s/.thumbs/256x256/.lrmate200id4s.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:50 \ No newline at end of file diff --git a/fanuc_lrmate200id4s/.thumbs/256x256/lrmate200id4s.usda.png b/fanuc_lrmate200id4s/.thumbs/256x256/lrmate200id4s.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..996ed7db3c4d110489dd6fd362841f1144ba4152 --- /dev/null +++ b/fanuc_lrmate200id4s/.thumbs/256x256/lrmate200id4s.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5987ad69ec579b8f0ba1e559f5086f3d4ca02b168c9303af12af7a9570b9c744 +size 43197 diff --git a/fanuc_lrmate200id4s/.thumbs/lrmate200id4s.thumb.usd b/fanuc_lrmate200id4s/.thumbs/lrmate200id4s.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..44ec88b61705a7665b1404f5c7bb66b81e48e2dc Binary files /dev/null and b/fanuc_lrmate200id4s/.thumbs/lrmate200id4s.thumb.usd differ diff --git a/fanuc_lrmate200id4s/com.nvidia.simready.packaging.json b/fanuc_lrmate200id4s/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..f2073bb8defac738b423b77300cd24312d3d91ed --- /dev/null +++ b/fanuc_lrmate200id4s/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id4s.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "6058314a7266efa499694eed2f0a3965969fc3c0775be8538c4c092d5995c8f7" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "3e8d72e59d81e35472bde8f192b6ca1ff49e6aea27fd541852a9e68914b42286" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "5da16ff56377520157fc3fcee1085e886b3139a68efec15ba83b5c5ac5106f17" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "674f8e21ce38c43c5652ef540f528716cabbc2e462bf4e1ca58933b3d977cfd5" + }, + "package_hash": { + "sha256": "c7c32c3209560f8e76de5c5f06fd14229042c64f622bd2f5fb02a8a6c90a9238" + } +} diff --git a/fanuc_lrmate200id4s/lrmate200id4s.usda b/fanuc_lrmate200id4s/lrmate200id4s.usda new file mode 100644 index 0000000000000000000000000000000000000000..7fbdc618542c36ce72373aa3887c0929febdaeef --- /dev/null +++ b/fanuc_lrmate200id4s/lrmate200id4s.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id4s" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id4s" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id4s" + 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.52720046, 0.19500296, 0.6664013) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id4s" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 20.00380024779588 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id4s/lrmate200id4s.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id4s" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id4s/materials/mdl/LICENSE.md b/fanuc_lrmate200id4s/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id4s/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id4s/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id4s/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id4s/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id4s/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id4s/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id4s/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/fanuc_lrmate200id4s/payloads/Physics/mujoco.usda b/fanuc_lrmate200id4s/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..4539ddd8582227b57dde3b9360868e1fd1bd1f86 --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id4s" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id4s/payloads/Physics/none.usda b/fanuc_lrmate200id4s/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..1f148df073105b6d87262112672b47cff3fab39d --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id4s" +{ +} + diff --git a/fanuc_lrmate200id4s/payloads/Physics/physics.usda b/fanuc_lrmate200id4s/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..18158fc90f66d4c458770e21f1e7626cfcedd4ff --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id4s" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 400 + float drive:angular:physics:stiffness = 2500 + 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.4516096 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -169.99998 + float physics:upperLimit = 169.99998 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 2500 + 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.3285731 + 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) + float physics:lowerLimit = -109.99999 + float physics:upperLimit = 120 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 2500 + 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.47298396 + point3f physics:localPos0 = (0, 0, 0.26) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -68.99999 + float physics:upperLimit = 204.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 50 + float drive:angular:physics:stiffness = 2500 + 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.16068363 + point3f physics:localPos0 = (0, 0, 0.02) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 30 + float drive:angular:physics:stiffness = 2500 + 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.054614455 + point3f physics:localPos0 = (0.29, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -120 + float physics:upperLimit = 120 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.00009511787 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0281, 0.00396, 0.0799) + float3 physics:diagonalInertia = (0.021764794, 0.03024627, 0.029488938) + float physics:mass = 5.15 + quatf physics:principalAxes = (0.9960849, 0.061740834, 0.00030157834, 0.06326905) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00151, 0.000041, -0.0578) + float3 physics:diagonalInertia = (0.025207747, 0.01899999, 0.016192263) + float physics:mass = 4.17 + quatf physics:principalAxes = (0.9998926, 0.00023814883, -0.014649395, -0.0005277535) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00721, -0.000956, 0.13) + float3 physics:diagonalInertia = (0.07690479, 0.06720917, 0.025186036) + float physics:mass = 6.67 + quatf physics:principalAxes = (0.99995553, -0.00753474, 0.00461813, 0.0032855284) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00781, -0.00446, -0.00000291) + float3 physics:diagonalInertia = (0.0034358436, 0.0042493218, 0.004394834) + float physics:mass = 1.66 + quatf physics:principalAxes = (0.9630641, 0.032912303, -0.26695275, 0.012676877) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.187, 0.00165, 0.00184) + float3 physics:diagonalInertia = (0.0026594459, 0.011499464, 0.01160109) + float physics:mass = 1.95 + quatf physics:principalAxes = (0.99933004, 0.036387328, 0.0039215116, -0.0003486877) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0172, 0.000903, -0.00000423) + float3 physics:diagonalInertia = (0.00026780626, 0.00045319373, 0.000425) + float physics:mass = 0.39 + quatf physics:principalAxes = (0.9998693, -0.0003113006, -0.00002626526, -0.0161659) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.069, 5.91e-19, -2.85e-19) + float3 physics:diagonalInertia = (0.00000274, 0.00000153, 0.00000153) + float physics:mass = 0.0138 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id4s/payloads/Physics/physx.usda b/fanuc_lrmate200id4s/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..cbba294b2b399e8f0d205135147c50b55073f4bc --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id4s" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 460 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 460 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 899.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id4s/payloads/Sensor/none.usda b/fanuc_lrmate200id4s/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..1f148df073105b6d87262112672b47cff3fab39d --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id4s" +{ +} + diff --git a/fanuc_lrmate200id4s/payloads/Sensor/sensors.usda b/fanuc_lrmate200id4s/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..d66115c4701900138e3f2c1a0130fc809b73cb64 --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id4s" +{ +} + diff --git a/fanuc_lrmate200id4s/payloads/base.usda b/fanuc_lrmate200id4s/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..1a4dc76ce57d94ecf705d9fb6c5ea75806810dac --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id4s" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.5900000333786011) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.6100000143051147) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.28999999165534973, 0, 0.6100000143051147) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.28999999165534973, 0, 0.6100000143051147) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07000000029802322, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id4s/payloads/geometries.usd b/fanuc_lrmate200id4s/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..ec8fba240a9a70faf6f05cb1d6f09b1756cfef9b --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06759cf2812669b01743edc9e4b49a23b03c1d0f8efd5e6125916ec7dcc9642c +size 7323365 diff --git a/fanuc_lrmate200id4s/payloads/instances.usda b/fanuc_lrmate200id4s/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..a352df3bb6666c8ac4059d851129718d954e6622 --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/instances.usda @@ -0,0 +1,1174 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + 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_1" ( + 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_2" ( + 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_3" ( + 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_4" ( + 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_1" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_10" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7333333, 0.7333333, 0.7333333) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_11" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_12" ( + 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_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_13" ( + 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_14" ( + 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_3" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_lrmate200id4s/payloads/materials.usda b/fanuc_lrmate200id4s/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..b9d646157ecbf86cf9157ddde1d8f662d7ef0902 --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/materials.usda @@ -0,0 +1,1760 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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_1" + { + 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_1" ( + 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_2" + { + 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_2" ( + 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_3" + { + 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_3" ( + 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_4" + { + 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_4" ( + 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 "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: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_5" + { + 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_0" ( + 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, 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 = (1, 1, 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_6" + { + 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_1" ( + 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, 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 = (1, 1, 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_9" + { + 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_1" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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_10" + { + 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_2" ( + 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.7333333, 0.7333333, 0.7333333) ( + 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.7333333, 0.7333333, 0.7333333) + 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_11" + { + 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_3" ( + 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.8000001, 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.8000001, 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 + } + } +} + diff --git a/fanuc_lrmate200id4s/payloads/robot.usda b/fanuc_lrmate200id4s/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..c1b9a31b5444e9fc64a410d5f871f3ecc7928738 --- /dev/null +++ b/fanuc_lrmate200id4s/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id4s" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id4s/runnables/physics/mujoco.usda b/fanuc_lrmate200id4s/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..360157bf17cc6527de655ea2beb7433730732924 --- /dev/null +++ b/fanuc_lrmate200id4s/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id4s" +) + +def "lrmate200id4s" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id4s_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 400 + double mjc:forceRange:min = -400 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id4s_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id4s_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id4s_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id4s_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id4s_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_lrmate200id4s/runnables/physics/newton.usda b/fanuc_lrmate200id4s/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..740575ba3c21155e2c27d1e116bed2eae796b72a --- /dev/null +++ b/fanuc_lrmate200id4s/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id4s" +) + +over "lrmate200id4s" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 32.6087 + float newton:damping = 1.086957 + float newton:velocityLimit = 460 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 16.3043 + float newton:damping = 0.543478 + float newton:velocityLimit = 460 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 14.4231 + float newton:damping = 0.480769 + float newton:velocityLimit = 520 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 3.3482 + float newton:damping = 0.111607 + float newton:velocityLimit = 559.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.0089 + float newton:damping = 0.066964 + float newton:velocityLimit = 559.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.8333 + float newton:damping = 0.027778 + float newton:velocityLimit = 899.99994 + } + } +} + diff --git a/fanuc_lrmate200id4s/runnables/physics/physx.usda b/fanuc_lrmate200id4s/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..37aaa1962751332690f5a46b9cdfc11bbcf55925 --- /dev/null +++ b/fanuc_lrmate200id4s/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id4s" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id4s" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 460 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 460 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 559.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 899.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..122121b7d5b4f15155519c45db24d80294d80343 --- /dev/null +++ b/fanuc_lrmate200id7c/.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:16", + "assets": [ + { + "asset": "lrmate200id7c.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/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..5fa9245155ff195d278d3bdb380da07f91546420 --- /dev/null +++ b/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id7c.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "10d0ab6e9922bbc06bac5a165d2f39e15350511f29d1703ea3f796a3bfed5bad", + "sha256": "fae4643ccc3485bb0893326ee2021069e4180cfe1f0f44b3446ac65d2647e8c4" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id7c.usda.png", + "size": 37812, + "hash": { + "sha256-flat-1mb": "c563de1d7032044d4a649fcd6d75a85081ec8817126abf6b5d9ee11ff0737fc2", + "sha256": "1700cd677af5cc6277ef01300313e87300871fd8f1d5a34352e73635f49b4cdb" + } + }, + { + "relative_path": ".thumbs/lrmate200id7c.thumb.usd", + "size": 6129, + "hash": { + "sha256-flat-1mb": "d6815c15d2c48a79fb334ccfa9bd4dd81b6038dc6c4b853caecdf0a0931407ca", + "sha256": "299e41d3accc6d01d3f91d43e856a267024c26d9103bd74c0011804e8737d657" + } + }, + { + "relative_path": "lrmate200id7c.usda", + "size": 16033, + "hash": { + "sha256-flat-1mb": "5a8fe89d741417c08346df84f5fcf0ada4c3134c03042c8b0ae7abc17706a69d", + "sha256": "6cc8eb79021c21420cd154aff6aace736fe7bbc79f28928f1d3ec862284e3565" + } + }, + { + "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": 2921, + "hash": { + "sha256-flat-1mb": "14ae367b74d72784b498b25d3afbcc40e1387987d82d20b53cebdfea2fbc59ef", + "sha256": "275f2bf9fd26d25b9459bd157ef938951196cb6c7134cfb8aa8a0786c14dc1f8" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 143, + "hash": { + "sha256-flat-1mb": "3e2d311c4e5a2d6faa581997e6a12bcedf4556fd13c335f3050d8c953781bde9", + "sha256": "d2b9e5e10d9260a0fb999f5bcd56c153e5c7f72983040960041a3e26e6dad925" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12102, + "hash": { + "sha256-flat-1mb": "67ead9e912a36ccf6a3cff46904c785d25227c1414876750cd6b4c08609e3f7f", + "sha256": "c5697e690a9778ddf679ecc998441bf9b95c4148b6adea69b23e69409e130900" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1450, + "hash": { + "sha256-flat-1mb": "24feb63e790a64280ad9847088f0cface97c208722027b303a0f4a857b4d7047", + "sha256": "0d2def039ff22d7493626d6024f43ac7550cd3eeaf8ca8f3ca88213911a63baa" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 143, + "hash": { + "sha256-flat-1mb": "3e2d311c4e5a2d6faa581997e6a12bcedf4556fd13c335f3050d8c953781bde9", + "sha256": "d2b9e5e10d9260a0fb999f5bcd56c153e5c7f72983040960041a3e26e6dad925" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 149, + "hash": { + "sha256-flat-1mb": "dc242eea89d119d05d8f4249c302b6801aeeb78c17062454aaacf9be93f6bc70", + "sha256": "d424ca2a0a9bf5cd41d24f55a069422af60fa440dd7bd96b416b9aa448ca744b" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11559, + "hash": { + "sha256-flat-1mb": "56835a6e23c46cd78d5aa2f4e02a952873fb17c1209f1c4ea82175ca39b545ac", + "sha256": "612a823c560adf124b422028143b6dbd31f0953c6a85365a3cc8e4c7ff777ee7" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 6942219, + "hash": { + "sha256-flat-1mb": "a4b8c34fca37be3974d5f2aaa1c4a3d0ac9552ffd03616015973fd9210f12c0c", + "sha256": "1fa7525e9b28a643cca1dc3c0734437bd1fe5bb904aa0bafafbd557b2a3d27c3", + "sha256-first1m": "e32d8425609d12e4f0253523165d774d4088bce7e361939aafa79b0d07920781" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 28511, + "hash": { + "sha256-flat-1mb": "1d8088ff76aa04160f6e8ab2ce75c6422242b5e89889a91c4cc1899ac1ea99aa", + "sha256": "545532d7a76b6f706a2eacdaf7744dd66336ed225d8dce15b02bb9c60a1debbf" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 44795, + "hash": { + "sha256-flat-1mb": "6f8d0e9cfd653428ece49311ed42e4b3753dce0b4c2eed8e1d83a822beaad6b9", + "sha256": "e728d542499f044a155daee14a0b0e4da49ab686e974fd1d89391b0e2f370203" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3009, + "hash": { + "sha256-flat-1mb": "9c581f7a451ca90b0be7fee9f7010d02221c3c623c05cddc785ec47548667591", + "sha256": "79543db68cdd16f0c0e913a6628c308ab7f25fdef77724bfdad17a95dfe9c944" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8218, + "hash": { + "sha256-flat-1mb": "cd2e0c3564845ce2cf34f8b6ffaa8f1b77038ff16fba5d546eeb8f2f1d7c9e94", + "sha256": "bd0d97c78b81af66e86587dfbf023c01eeda04a8ebc1db0213f1e9ff8d8ac229" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4912, + "hash": { + "sha256-flat-1mb": "73a47ca9361b091903452b7b0f7f2317663c9ebbaf97f803af4f0acbf9af1384", + "sha256": "63cad0a822042c1c28da3bf395dd76eca23c107c70d73b3b3b193bdec1a9099b" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3540, + "hash": { + "sha256-flat-1mb": "25920666421b1c43f89f119250a9f61c0fad51f531ea2c768863e8754143dfe0", + "sha256": "38ffd84c910a0d6f7fb6b0f7f987e0551699b9d02de8de08b69d82a78c94fa7e" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..b26b0dde1bda642be56a8241ae2d554cf7d8695d --- /dev/null +++ b/fanuc_lrmate200id7c/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id7c.usda" + ] +} diff --git a/fanuc_lrmate200id7c/.metadata/license.txt b/fanuc_lrmate200id7c/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id7c/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id7c/.simready/validation.json b/fanuc_lrmate200id7c/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id7c/.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/fanuc_lrmate200id7c/.thumbs/256x256/.lrmate200id7c.usda.last_generated b/fanuc_lrmate200id7c/.thumbs/256x256/.lrmate200id7c.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..91b2d6cb35e3f6a7348e037c8bea3b96762241ec --- /dev/null +++ b/fanuc_lrmate200id7c/.thumbs/256x256/.lrmate200id7c.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:54 \ No newline at end of file diff --git a/fanuc_lrmate200id7c/.thumbs/256x256/lrmate200id7c.usda.png b/fanuc_lrmate200id7c/.thumbs/256x256/lrmate200id7c.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..27822dcc780162d11a6139a481b1f780930f4072 --- /dev/null +++ b/fanuc_lrmate200id7c/.thumbs/256x256/lrmate200id7c.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1700cd677af5cc6277ef01300313e87300871fd8f1d5a34352e73635f49b4cdb +size 37812 diff --git a/fanuc_lrmate200id7c/.thumbs/lrmate200id7c.thumb.usd b/fanuc_lrmate200id7c/.thumbs/lrmate200id7c.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..7bcb1080a7174850fe819902fa073192d6255fe7 Binary files /dev/null and b/fanuc_lrmate200id7c/.thumbs/lrmate200id7c.thumb.usd differ diff --git a/fanuc_lrmate200id7c/com.nvidia.simready.packaging.json b/fanuc_lrmate200id7c/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..63285860f60dd7093f550bcaca1013cc47aa7854 --- /dev/null +++ b/fanuc_lrmate200id7c/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id7c.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "0d2d5f1026ae7e80a10e11559821b85c15361d79bdbcdaba4c695300c6565801" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "5e5b03ec7c9b1923e55cddc27c219ddc6514d6134ad08f031de91edcfaab1848" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "14318e0dde0849456187acf089ff18aedca760c620922f86ae9fe068b1f34e8a" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "0b9892a5082a41053a8891175143cac4e42ddab8470972e3e5a545a18c6c8c5c" + }, + "package_hash": { + "sha256": "bbc7ded51fd2f83c5385fc6cc887d0ed45bff1a3efe3e88136438d7e48816d3c" + } +} diff --git a/fanuc_lrmate200id7c/lrmate200id7c.usda b/fanuc_lrmate200id7c/lrmate200id7c.usda new file mode 100644 index 0000000000000000000000000000000000000000..c0f77b725c140d5b79e2afcc503d26deb6a0f23a --- /dev/null +++ b/fanuc_lrmate200id7c/lrmate200id7c.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id7c" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id7c" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id7c" + 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.6224005, 0.23500204, 0.75890136) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id7c" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 24.99200096912682 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id7c/lrmate200id7c.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7c" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id7c/materials/mdl/LICENSE.md b/fanuc_lrmate200id7c/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id7c/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id7c/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id7c/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id7c/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id7c/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id7c/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id7c/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/fanuc_lrmate200id7c/payloads/Physics/mujoco.usda b/fanuc_lrmate200id7c/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..57dcd2f932c30bcba8c17ac838751e4a29a0099e --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7c" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7c/payloads/Physics/none.usda b/fanuc_lrmate200id7c/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..e5f8b7aab9d0968bb32a20487e5dff8b04fd0d1a --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7c" +{ +} + diff --git a/fanuc_lrmate200id7c/payloads/Physics/physics.usda b/fanuc_lrmate200id7c/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..aaf277f5d4fead799dfec2c27fa8fecbb0670efc --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7c" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 500 + float drive:angular:physics:stiffness = 2500 + 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.4783025 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 500 + float drive:angular:physics:stiffness = 2500 + 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.46468127 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 200 + float drive:angular:physics:stiffness = 2500 + 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.9282412 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 204.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.28003988 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 40 + float drive:angular:physics:stiffness = 2500 + 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.09634335 + point3f physics:localPos0 = (0.335, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.00021180251 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.014600002, -0.00034200004, 0.0796) + float3 physics:diagonalInertia = (0.02492984, 0.030544592, 0.03212557) + float physics:mass = 5.28 + quatf physics:principalAxes = (0.997418, 0.046811927, 0.022051139, 0.04979884) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.04411728, 0.030222429, 0.029560294) + float physics:mass = 5.61 + quatf physics:principalAxes = (0.97288525, 0.09019549, 0.21196717, -0.020711767) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00271, -0.000976, 0.159) + float3 physics:diagonalInertia = (0.15800025, 0.1360125, 0.042787284) + float physics:mass = 9.02 + quatf physics:principalAxes = (0.99998283, -0.005793622, -0.00066144613, 0.0007229967) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.005497772, 0.0066423425, 0.006999886) + float physics:mass = 2.15 + quatf physics:principalAxes = (0.9698054, 0.019367054, -0.24089429, 0.03274631) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.223, 0.00356, 0.00215) + float3 physics:diagonalInertia = (0.0039395997, 0.01699075, 0.017009651) + float physics:mass = 2.41 + quatf physics:principalAxes = (0.9258902, 0.37778258, 0.0025582511, -0.0010567331) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0236, 0.00233, -0.00000699) + float3 physics:diagonalInertia = (0.0003896634, 0.00078333664, 0.000741) + float physics:mass = 0.501 + quatf physics:principalAxes = (0.9995751, -0.00035316136, -0.000021165177, -0.02914692) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0836, -3.24e-19, -1.22e-18) + float3 physics:diagonalInertia = (0.00000504, 0.00000296, 0.00000296) + float physics:mass = 0.021 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id7c/payloads/Physics/physx.usda b/fanuc_lrmate200id7c/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..8207de0e7c314d3ce636ddf30807a1b4b8b54113 --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id7c" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 380 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id7c/payloads/Sensor/none.usda b/fanuc_lrmate200id7c/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..e5f8b7aab9d0968bb32a20487e5dff8b04fd0d1a --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7c" +{ +} + diff --git a/fanuc_lrmate200id7c/payloads/Sensor/sensors.usda b/fanuc_lrmate200id7c/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..92295c2d1ffc157fec04dd12974215df5bd6e939 --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7c" +{ +} + diff --git a/fanuc_lrmate200id7c/payloads/base.usda b/fanuc_lrmate200id7c/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..9cd266a549bbb129829eb3d1cfb3a2afd33de3fb --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id7c" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6600000262260437) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.09000000357627869, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7c/payloads/geometries.usd b/fanuc_lrmate200id7c/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..108545210396dc75bc759e8540138a0ff1c50e5a --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fa7525e9b28a643cca1dc3c0734437bd1fe5bb904aa0bafafbd557b2a3d27c3 +size 6942219 diff --git a/fanuc_lrmate200id7c/payloads/instances.usda b/fanuc_lrmate200id7c/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..4b2086c7fb1a1fd982cb982ba2cc2f5db7c5e7c2 --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/instances.usda @@ -0,0 +1,835 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4980392, 0.4980392, 0.4980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.6980392, 0.6980392, 0.6980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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 = 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 "Material_7" ( + 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 = 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 "Material_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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_7" ( + 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 = 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 "mesh_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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/fanuc_lrmate200id7c/payloads/materials.usda b/fanuc_lrmate200id7c/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..603382e5eb5b42d8984e82f1f7fc21cd36089379 --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/materials.usda @@ -0,0 +1,1286 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.4980392, 0.4980392, 0.4980392) ( + 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.4980392, 0.4980392, 0.4980392) + 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_1" + { + 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_1" ( + 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:metallic_constant = 0 + 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_2" + { + 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_0" ( + 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_3" + { + 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_0" ( + 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_4" + { + 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_1" ( + 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.6980392, 0.6980392, 0.6980392) ( + 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.6980392, 0.6980392, 0.6980392) + 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_5" + { + 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_2" ( + 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.8000001, 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.8000001, 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_6" + { + 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_0" ( + 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:metallic_constant = 1 + 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 = 1 + 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_7" + { + 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_1" ( + 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:metallic_constant = 1 + 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 = 1 + 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/fanuc_lrmate200id7c/payloads/robot.usda b/fanuc_lrmate200id7c/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..2b7196168c6e50e4faeb1a72a6e327b4869f8c20 --- /dev/null +++ b/fanuc_lrmate200id7c/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7c" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id7c/runnables/physics/mujoco.usda b/fanuc_lrmate200id7c/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..ad6e6c0eac5c653a4e34d012271d7143d1f4dd91 --- /dev/null +++ b/fanuc_lrmate200id7c/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7c" +) + +def "lrmate200id7c" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id7c_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 500 + double mjc:forceRange:min = -500 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7c_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 500 + double mjc:forceRange:min = -500 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7c_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + 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_lrmate200id7c_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7c_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 40 + double mjc:forceRange:min = -40 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7c_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_lrmate200id7c/runnables/physics/newton.usda b/fanuc_lrmate200id7c/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..36016741a258776849d33642d27053cfa91f027d --- /dev/null +++ b/fanuc_lrmate200id7c/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7c" +) + +over "lrmate200id7c" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 41.6667 + float newton:damping = 1.388889 + float newton:velocityLimit = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 49.3421 + float newton:damping = 1.644737 + float newton:velocityLimit = 380 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 14.4231 + float newton:damping = 0.480769 + float newton:velocityLimit = 520 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.7727 + float newton:damping = 0.159091 + float newton:velocityLimit = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.7523 + float newton:damping = 0.091743 + float newton:velocityLimit = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.75 + float newton:damping = 0.025 + float newton:velocityLimit = 999.99994 + } + } +} + diff --git a/fanuc_lrmate200id7c/runnables/physics/physx.usda b/fanuc_lrmate200id7c/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..4539467556f5ce86c5a67f3c193aef0889ca9ac9 --- /dev/null +++ b/fanuc_lrmate200id7c/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7c" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7c" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 380 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 520 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..70dc351a4937cc53a81311c3363bce8ec2a510b7 --- /dev/null +++ b/fanuc_lrmate200id7l/.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:16", + "assets": [ + { + "asset": "lrmate200id7l.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/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..5454ebb4ecbca0033ae2cc3960d9b7a2b413e087 --- /dev/null +++ b/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id7l.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "bd55c0ee82f7da22336a7d707647c6ce90789c55397a736ad4711a3ac6330040", + "sha256": "1f2e6c0676856e4952ab037e874919c39f00cf3c720235e75cc60dcb77ff4675" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id7l.usda.png", + "size": 42694, + "hash": { + "sha256-flat-1mb": "5581c98f9a23d6520f29f5d794121ef71319267a2c930f07e02239b44399cd09", + "sha256": "1cbf67edd902f5ddcaa338daf8c101d39e7747f3c7e6077d89e1a8b36d254935" + } + }, + { + "relative_path": ".thumbs/lrmate200id7l.thumb.usd", + "size": 6129, + "hash": { + "sha256-flat-1mb": "bb7378c280cca443860c1bc7c2f9a3a7bb4c9e76e02dc0134d16aa48684c480b", + "sha256": "91145a7b9d267aa0508c5cfd4d06e4e0c83a0507295744d10878c5cdd0f9aeae" + } + }, + { + "relative_path": "lrmate200id7l.usda", + "size": 16033, + "hash": { + "sha256-flat-1mb": "c31237d13a9711c95eaf80d8b255d7701dd933bf49b5aa63fb0c574b21fd70ad", + "sha256": "73350adb176e18a1023f0d2addd0d719b0847e04e71400fabd22bac1e32c586f" + } + }, + { + "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": 2921, + "hash": { + "sha256-flat-1mb": "949b58d906330dcbb3247baa2051b582e70cdd3136e32b2a75f4b5f7ac7f0fde", + "sha256": "42aa4cc27eac5b1132b096498a31c1e8ce6e68c74d7a1cdd93d988357007f686" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 143, + "hash": { + "sha256-flat-1mb": "1f692f44f16e98ef139cef6fae017bfef4fbebdabeaec2594a3d5a0309692e8c", + "sha256": "ece1686ed42877c93617ebc0dd1a208d5995fca26f339c7434053b55e1341eb4" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12094, + "hash": { + "sha256-flat-1mb": "9ee64bd284393dbf8068fadf934f137bc07df4554ef09dc427947beb41ab0b0b", + "sha256": "ffcafb2517875407043e3d1ee7c9d07f5044087979bd47e43fd015cfd9c9f450" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1456, + "hash": { + "sha256-flat-1mb": "4430337beb9286055d257764cdb4d106cd25a77f84de9c80b9daa57088c435b5", + "sha256": "cb292851e92f16b96345a9e0cea763206e669f747f681c6ca330ca446dbe79ab" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 143, + "hash": { + "sha256-flat-1mb": "1f692f44f16e98ef139cef6fae017bfef4fbebdabeaec2594a3d5a0309692e8c", + "sha256": "ece1686ed42877c93617ebc0dd1a208d5995fca26f339c7434053b55e1341eb4" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 149, + "hash": { + "sha256-flat-1mb": "e6b489019babbe312e778c043cba8459eacddb4b9f3570aa7d702b1b9ad35192", + "sha256": "f8d56e919be5a328c154c4a8dfb59f6eae486e7e52178c6fff0996d51a3052be" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11559, + "hash": { + "sha256-flat-1mb": "6d7103927f47f90f8052a28453625a6f0fa8b063a2c87a870aefa4d950d42087", + "sha256": "210ca412cb5b7a326e9bc8946c943989b276a7c72eeea399c2ad92c7ab8e5f66" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 6741089, + "hash": { + "sha256-flat-1mb": "edaacd351d768c237c6a1f8342cdc7cfae80dc9250fe607e3d690d10fd706959", + "sha256": "b06387fa99a69e58b9d773eb5bb717b86efa292bc55a61be15a8df08b4ae0c63", + "sha256-first1m": "07fbfe28226132354cb7b80b332651988f5534781fe102770d2a931cc305452f" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 38596, + "hash": { + "sha256-flat-1mb": "5764471c0b5d95bfd6cb086d820de4ddffb0a837faff1789980d76a6868c87a7", + "sha256": "075f7913d45af6cfe2db5299fbd0641268dac8d454b8e502767c329101b3f492" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61507, + "hash": { + "sha256-flat-1mb": "9e05ea5dd7532479bb23f6213472318e039ee8fa7c7c181ea83b660850e13fac", + "sha256": "2ef2bc8561dd0c52114872236700f138cdff39eaa58457c835eaa626a0f8186f" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3009, + "hash": { + "sha256-flat-1mb": "626e37eff32ae79ddbfa0725df7bb762d4cdfd711c00e4a291ab5365b38577af", + "sha256": "7e22b69b74e6329b97d0c6fd05412a7e71fe009ca0562e2e02f8907fe338b7cd" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8218, + "hash": { + "sha256-flat-1mb": "cdfca9a7ca4a7f7b109c18ec8498c63784f87c27797096b5e27505e51d2bd086", + "sha256": "23cc221c7bd6cef3cbb10153c54316768a981748bed19c294d0f3a1f1e383677" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4917, + "hash": { + "sha256-flat-1mb": "e74639c79b417c29dae85a4ae964758dc1c96e180a97f1b109b0086d93abd332", + "sha256": "756dbc2880462a0971ca3185577e8106e551c5af118a9f5bfbc78b78e96c60e9" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3546, + "hash": { + "sha256-flat-1mb": "baa11c012b3e75686172695e3694d4cb0d31ed4b7443f89e7e6d3513a169058e", + "sha256": "a2328399a2d98a0b187d3c6308986c29096303d104f91dc1fb6c2540ec5966c9" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..c87df6aace6e80ddd54251702b198f5a0824e8bd --- /dev/null +++ b/fanuc_lrmate200id7l/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id7l.usda" + ] +} diff --git a/fanuc_lrmate200id7l/.metadata/license.txt b/fanuc_lrmate200id7l/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id7l/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id7l/.simready/validation.json b/fanuc_lrmate200id7l/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id7l/.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/fanuc_lrmate200id7l/.thumbs/256x256/.lrmate200id7l.usda.last_generated b/fanuc_lrmate200id7l/.thumbs/256x256/.lrmate200id7l.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..e21a9781298f87aa386c322ad27be2d2ab807173 --- /dev/null +++ b/fanuc_lrmate200id7l/.thumbs/256x256/.lrmate200id7l.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:28:58 \ No newline at end of file diff --git a/fanuc_lrmate200id7l/.thumbs/256x256/lrmate200id7l.usda.png b/fanuc_lrmate200id7l/.thumbs/256x256/lrmate200id7l.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..531eeb3483929c58245fe9d5af4203aa00171fb8 --- /dev/null +++ b/fanuc_lrmate200id7l/.thumbs/256x256/lrmate200id7l.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cbf67edd902f5ddcaa338daf8c101d39e7747f3c7e6077d89e1a8b36d254935 +size 42694 diff --git a/fanuc_lrmate200id7l/.thumbs/lrmate200id7l.thumb.usd b/fanuc_lrmate200id7l/.thumbs/lrmate200id7l.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..a6329cf8740e4f37a4e1027051d5b6a8e5130bf8 Binary files /dev/null and b/fanuc_lrmate200id7l/.thumbs/lrmate200id7l.thumb.usd differ diff --git a/fanuc_lrmate200id7l/com.nvidia.simready.packaging.json b/fanuc_lrmate200id7l/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..8287e4673ba5c1ff81b3494490ba2957944e6e90 --- /dev/null +++ b/fanuc_lrmate200id7l/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id7l.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "dcf84e7a56068adb17d8e460c13696d471c5ea56039055fca37a00b9fe194158" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "6aee3c903d78b001862cec375663a717b4d65b69e5016f6800ac5c9759fe1685" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "a89b82fb911053d99d5ca19c4e20e417d50ee807aabcd9d6b06d58c8be0ed188" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "fdb71e3746c59e6adabc1298443e1213492897cd23eefe0c237296fc2cb06413" + }, + "package_hash": { + "sha256": "24b67c6489f557b26b3fa30ee52d02fd1e59a10e70b9af9a95820975fca11959" + } +} diff --git a/fanuc_lrmate200id7l/lrmate200id7l.usda b/fanuc_lrmate200id7l/lrmate200id7l.usda new file mode 100644 index 0000000000000000000000000000000000000000..faafce063309bbb6e0be14267524c3c2727d659a --- /dev/null +++ b/fanuc_lrmate200id7l/lrmate200id7l.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id7l" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id7l" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id7l" + 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.6954005, 0.23500204, 0.8689013) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id7l" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 26.980899488553405 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id7l/lrmate200id7l.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7l" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id7l/materials/mdl/LICENSE.md b/fanuc_lrmate200id7l/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id7l/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id7l/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id7l/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id7l/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id7l/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id7l/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id7l/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/fanuc_lrmate200id7l/payloads/Physics/mujoco.usda b/fanuc_lrmate200id7l/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..b49749e242255255051042c5a600dd97ac024ce4 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7l" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7l/payloads/Physics/none.usda b/fanuc_lrmate200id7l/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..7f1e6f111de5acdf35e3cf234166b1ad758c6854 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7l" +{ +} + diff --git a/fanuc_lrmate200id7l/payloads/Physics/physics.usda b/fanuc_lrmate200id7l/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..164f2c5318b071ef7aa0a605a407e197f7899751 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7l" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 600 + float drive:angular:physics:stiffness = 2500 + 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.47102547 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 600 + float drive:angular:physics:stiffness = 2500 + 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.50967014 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 300 + float drive:angular:physics:stiffness = 2500 + 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 = 1.6201171 + point3f physics:localPos0 = (0, 0, 0.44) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 212.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.45439643 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 40 + float drive:angular:physics:stiffness = 2500 + 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.1201405 + point3f physics:localPos0 = (0.42, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.00010202705 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0146, -0.00034199998, 0.0796) + float3 physics:diagonalInertia = (0.02403238, 0.02944247, 0.030925151) + float physics:mass = 5.09 + quatf physics:principalAxes = (0.9973477, 0.048264433, 0.02222265, 0.049742773) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.04253522, 0.029123956, 0.028540822) + float physics:mass = 5.41 + quatf physics:principalAxes = (0.97182727, 0.099421754, 0.21247762, -0.022811107) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00311, -0.00124, 0.217) + float3 physics:diagonalInertia = (0.28000227, 0.25501862, 0.051079098) + float physics:mass = 10.9 + quatf physics:principalAxes = (0.9999872, -0.0047821454, -0.0015663651, 0.0005184825) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.00529951, 0.00640227, 0.006748221) + float physics:mass = 2.07 + quatf physics:principalAxes = (0.9697991, 0.019287033, -0.24092257, 0.032774962) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.266, 0.00354, 0.00226) + float3 physics:diagonalInertia = (0.0051099635, 0.034700915, 0.034599118) + float physics:mass = 3.07 + quatf physics:principalAxes = (0.9988725, -0.047469597, 0.0005209576, 0.00018055725) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0177, 0.0025, -0.00000419) + float3 physics:diagonalInertia = (0.0003247349, 0.000579265, 0.000542) + float physics:mass = 0.428 + quatf physics:principalAxes = (0.9993777, -0.00024123333, -0.00003497771, -0.035272483) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.074, 3.35e-18, -4.88e-19) + float3 physics:diagonalInertia = (0.00000264, 0.00000148, 0.00000148) + float physics:mass = 0.0129 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id7l/payloads/Physics/physx.usda b/fanuc_lrmate200id7l/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..63e374e7310318e45b9f333803f63283a9efad35 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id7l" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 370 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 309.99997 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id7l/payloads/Sensor/none.usda b/fanuc_lrmate200id7l/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..7f1e6f111de5acdf35e3cf234166b1ad758c6854 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7l" +{ +} + diff --git a/fanuc_lrmate200id7l/payloads/Sensor/sensors.usda b/fanuc_lrmate200id7l/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..0cef245d03f015c99a89336c5bd50c42968aafe2 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7l" +{ +} + diff --git a/fanuc_lrmate200id7l/payloads/base.usda b/fanuc_lrmate200id7l/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..67940d899811a2d02c4028b293924b61f18a4706 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id7l" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.7699999809265137) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.4699999988079071, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.4699999988079071, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07999999821186066, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7l/payloads/geometries.usd b/fanuc_lrmate200id7l/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..13312ac9e92ce14110530f4f2fd905449d44e88b --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b06387fa99a69e58b9d773eb5bb717b86efa292bc55a61be15a8df08b4ae0c63 +size 6741089 diff --git a/fanuc_lrmate200id7l/payloads/instances.usda b/fanuc_lrmate200id7l/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..acf837afd5f72b49fc8f8833dd9abc9193f3e58d --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/instances.usda @@ -0,0 +1,1105 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.05, 0.05, 0.05) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4980392, 0.4980392, 0.4980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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 = ["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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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 "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_5" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7333333, 0.7333333, 0.7333333) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.9333334, 0.9333334, 0.9333334) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_7" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_4" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_5" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_6" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_10" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 0.8000001, 0.8000001) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_6" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_3" ( + 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 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_11" ( + 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_3" ( + 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_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_8" ( + 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_3" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_lrmate200id7l/payloads/materials.usda b/fanuc_lrmate200id7l/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..1b8e574493e87b1317c4b51d8c0d7e2e232fb4e2 --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/materials.usda @@ -0,0 +1,1760 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.05, 0.05, 0.05) ( + 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.05, 0.05, 0.05) + 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_1" + { + 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_1" ( + 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.4980392, 0.4980392, 0.4980392) ( + 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.4980392, 0.4980392, 0.4980392) + 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_2" + { + 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_2" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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" + { + 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_3" + { + 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_0" ( + 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_4" + { + 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_1" ( + 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, 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 = (1, 1, 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_5" + { + 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_0" ( + 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.7333333, 0.7333333, 0.7333333) ( + 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.7333333, 0.7333333, 0.7333333) + 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_7" + { + 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_2" ( + 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.9333334, 0.9333334, 0.9333334) ( + 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.9333334, 0.9333334, 0.9333334) + 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_9" + { + 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_2" ( + 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.8000001, 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.8000001, 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_10" + { + 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_3" ( + 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.8000001, 0.8000001, 0.8000001) ( + 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.8000001, 0.8000001, 0.8000001) + 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_11" + { + 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_1" ( + 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 + } + } +} + diff --git a/fanuc_lrmate200id7l/payloads/robot.usda b/fanuc_lrmate200id7l/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..522dcdfaf9cf2af9d41573cab8b8650e8aa2c87b --- /dev/null +++ b/fanuc_lrmate200id7l/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7l" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id7l/runnables/physics/mujoco.usda b/fanuc_lrmate200id7l/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..bb5f6ad1c6835a6368047cd08ec4e4ff34abafe1 --- /dev/null +++ b/fanuc_lrmate200id7l/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7l" +) + +def "lrmate200id7l" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id7l_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 600 + double mjc:forceRange:min = -600 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7l_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 600 + double mjc:forceRange:min = -600 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7l_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 300 + double mjc:forceRange:min = -300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7l_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7l_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 40 + double mjc:forceRange:min = -40 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7l_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_lrmate200id7l/runnables/physics/newton.usda b/fanuc_lrmate200id7l/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..7268af89e8f16ded66fd2bf4cc842f77d994ebbe --- /dev/null +++ b/fanuc_lrmate200id7l/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7l" +) + +over "lrmate200id7l" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 60.8108 + float newton:damping = 2.027027 + float newton:velocityLimit = 370 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 72.5806 + float newton:damping = 2.419355 + float newton:velocityLimit = 309.99997 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 27.439 + float newton:damping = 0.914634 + float newton:velocityLimit = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.7727 + float newton:damping = 0.159091 + float newton:velocityLimit = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.7523 + float newton:damping = 0.091743 + float newton:velocityLimit = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.75 + float newton:damping = 0.025 + float newton:velocityLimit = 999.99994 + } + } +} + diff --git a/fanuc_lrmate200id7l/runnables/physics/physx.usda b/fanuc_lrmate200id7l/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..407a23d50018b80ec0e8cd93135dfbf32abca55b --- /dev/null +++ b/fanuc_lrmate200id7l/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7l" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7l" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 370 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 309.99997 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..955d9364f101f5414d98b2e8ccf43b3875e41e2c --- /dev/null +++ b/fanuc_lrmate200id7lc/.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:16", + "assets": [ + { + "asset": "lrmate200id7lc.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/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..a53733bf3fe9f21bf6d6647adebd810ffd763c9b --- /dev/null +++ b/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id7lc.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "ad39dc96f96e525c2edea4811281bbf376697632623bedb7c9c5183c4ebd7a76", + "sha256": "7d4c6ac7c6c2f75de506830a9cbc459a20df103c866fd5eeb83a77d0c197cd5e" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id7lc.usda.png", + "size": 37291, + "hash": { + "sha256-flat-1mb": "1f4f86e1480f3bfa2e754640349ce3a61954c5480b3463b21b514746e08f6662", + "sha256": "59069e6245db65533bb2ac806c28ee196eccd359e59791ba8cb148884f5edff6" + } + }, + { + "relative_path": ".thumbs/lrmate200id7lc.thumb.usd", + "size": 6130, + "hash": { + "sha256-flat-1mb": "4ccd073648f5c93304a0948f05f8ecc6bab0fa2984d60060f3274c4d1cab22a3", + "sha256": "5dbb7c84e9c71ab672f84afef012aa4ed8dc60bab06ae36f7f7578f14ecc0859" + } + }, + { + "relative_path": "lrmate200id7lc.usda", + "size": 16041, + "hash": { + "sha256-flat-1mb": "c53016367520d973401c2a66e58e6c71b7b0d3513be18c735e12e06c971364f2", + "sha256": "3bbb3778905b20aa2e28e3a21befa328886d40810aff862c29733cf40351ef68" + } + }, + { + "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": 2922, + "hash": { + "sha256-flat-1mb": "42fe64291115dd22acdc4ee4828878b297a88285c5e08dbd8757ac893b251d18", + "sha256": "771a890483c6126ce6b7e2d6a39764867afb1ed165e8fe04757855dd4bf42104" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "4c7c6d4ad9a81be2fed5f1fde8ead6ec9563f96693f9dd022b3edc0625d02512", + "sha256": "3270c4d314aa54933eb69683535f9e75ce969a440e78953abf1fa5ca178e6b56" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12124, + "hash": { + "sha256-flat-1mb": "b292233c4d5852608904e9af5805d24bf4dfcf4e18f7d0b825aed4ee31875520", + "sha256": "46601277a7ca8e534fb6dacabd405550956933170bf5eae012b7e34831ec724c" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1458, + "hash": { + "sha256-flat-1mb": "535965c2dcc8ac33c83677a191bbd1a4bcda9663cb47f0301525c783db55405e", + "sha256": "be5277bee3682a0e9a7db05a4f368e845506155e3ebcffa57ad15882329e4db9" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "4c7c6d4ad9a81be2fed5f1fde8ead6ec9563f96693f9dd022b3edc0625d02512", + "sha256": "3270c4d314aa54933eb69683535f9e75ce969a440e78953abf1fa5ca178e6b56" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 151, + "hash": { + "sha256-flat-1mb": "d468636c5e119bc2a65cbc8fb350fffe2cf27acc3b414a58164759366efa21c2", + "sha256": "e25faaae919b1d970f2f10deae3a9d3b02e393442b47550adce358210c5060c3" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11561, + "hash": { + "sha256-flat-1mb": "8e9fda82bf2d17295c6ae2ccbff5454845344d4d5d860a6d082960f692194d31", + "sha256": "ec580e7beb731bce634149b832387446a3b12c3cfd7dbab4d1783ffee62bb2c2" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 6696912, + "hash": { + "sha256-flat-1mb": "5fd2eae24a1d2df908a5440bf8d712193ccee616e71bdecf0084590822fe99b8", + "sha256": "741d09f2a32a4a98547babb131f7ccdccee205cd70b6f7bd63e0fca30b965906", + "sha256-first1m": "f7fb35e499dab351fd9fb49ac9a2c989507249dae336f6648ea1582ad4597a00" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 28511, + "hash": { + "sha256-flat-1mb": "1d8088ff76aa04160f6e8ab2ce75c6422242b5e89889a91c4cc1899ac1ea99aa", + "sha256": "545532d7a76b6f706a2eacdaf7744dd66336ed225d8dce15b02bb9c60a1debbf" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 44748, + "hash": { + "sha256-flat-1mb": "4728bbe81fb6d67455c337463d3694d8bd37686d89ab08a601a85716704d8364", + "sha256": "4e2249692150edb3eb1a669ff90059295f218b225cf26fadc9509ff8f9a20ad8" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3025, + "hash": { + "sha256-flat-1mb": "e9a4d785185a06a5711d91ff8659957a137917fec79324bb819833d7510b977a", + "sha256": "7e26e3c9879c5ff5f5a1a2b08df24396d5d502918c618c0ce7bda6fabcb680d8" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8232, + "hash": { + "sha256-flat-1mb": "6dd9411a487f38b176ee79e3db445396c5e099162f09f630e615efc8e0cf88de", + "sha256": "b91ea9d12b9f2e77ec42e711d4b7191b14dc025d641bf6d172f39c991633d115" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4919, + "hash": { + "sha256-flat-1mb": "44bc0b55da6c11fa406d12d86e08b97ff5ca9183f26def4783191810e9e6a5e3", + "sha256": "261e81744c4601a0732cafbd92be490d88de468abc648508d6f012d0aa71758b" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3548, + "hash": { + "sha256-flat-1mb": "95a01d9fa88fb90776c66275884307b66f0538b7dda0047fb27c3ca54eef2e59", + "sha256": "bc8c479fac17e848f4976b117aba8287de66c73f2cd77672ce32ba9a605075dc" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..0bc2dbf512efdaa59faa5293716cfd99f00294b5 --- /dev/null +++ b/fanuc_lrmate200id7lc/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id7lc.usda" + ] +} diff --git a/fanuc_lrmate200id7lc/.metadata/license.txt b/fanuc_lrmate200id7lc/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id7lc/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id7lc/.simready/validation.json b/fanuc_lrmate200id7lc/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id7lc/.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/fanuc_lrmate200id7lc/.thumbs/256x256/.lrmate200id7lc.usda.last_generated b/fanuc_lrmate200id7lc/.thumbs/256x256/.lrmate200id7lc.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..371c71c18b2f7a91009ec0aa18e2b9b993aa521c --- /dev/null +++ b/fanuc_lrmate200id7lc/.thumbs/256x256/.lrmate200id7lc.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:29:03 \ No newline at end of file diff --git a/fanuc_lrmate200id7lc/.thumbs/256x256/lrmate200id7lc.usda.png b/fanuc_lrmate200id7lc/.thumbs/256x256/lrmate200id7lc.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..b931351970dcfefaad22f7c3a720ab2335a09852 --- /dev/null +++ b/fanuc_lrmate200id7lc/.thumbs/256x256/lrmate200id7lc.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59069e6245db65533bb2ac806c28ee196eccd359e59791ba8cb148884f5edff6 +size 37291 diff --git a/fanuc_lrmate200id7lc/.thumbs/lrmate200id7lc.thumb.usd b/fanuc_lrmate200id7lc/.thumbs/lrmate200id7lc.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..a02173a37d1d1fddddfa3b9cb4653efeb22a5a3f Binary files /dev/null and b/fanuc_lrmate200id7lc/.thumbs/lrmate200id7lc.thumb.usd differ diff --git a/fanuc_lrmate200id7lc/com.nvidia.simready.packaging.json b/fanuc_lrmate200id7lc/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..02ac98eeb5385bbef564067b188e7ab4437fa41a --- /dev/null +++ b/fanuc_lrmate200id7lc/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id7lc.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "f868f46f199a6bc96d38f9d07e0444667a933f7e8bb55696f23b0ecaff0663f4" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "533415e5f37e075117d8cdab43bc29e45383bf11a90594e01581b213b7cf8978" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "0c87dda46253d0f50112b8395d2f13880f89fbc0317bb36b5ac963239bb2b308" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "8dd174e4fd447a74ec64bd6df7a1a025c668ad237a863d5a508cbe467b535564" + }, + "package_hash": { + "sha256": "7436af96f9fe50c3e94f2f1756f4e500ab2131041ac5c5bafe11d551dd8219e3" + } +} diff --git a/fanuc_lrmate200id7lc/lrmate200id7lc.usda b/fanuc_lrmate200id7lc/lrmate200id7lc.usda new file mode 100644 index 0000000000000000000000000000000000000000..2e951be0d1765cd3e74be7fef250519c550e19f2 --- /dev/null +++ b/fanuc_lrmate200id7lc/lrmate200id7lc.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id7lc" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id7lc" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id7lc" + 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.7074005, 0.23500204, 0.8689013) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id7lc" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 27.022199496626854 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id7lc/lrmate200id7lc.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7lc" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id7lc/materials/mdl/LICENSE.md b/fanuc_lrmate200id7lc/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id7lc/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id7lc/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id7lc/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id7lc/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id7lc/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id7lc/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id7lc/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/fanuc_lrmate200id7lc/payloads/Physics/mujoco.usda b/fanuc_lrmate200id7lc/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..34174ba09c1dde9833e768aa578abd1e3074f143 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7lc" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7lc/payloads/Physics/none.usda b/fanuc_lrmate200id7lc/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..eddcf42d47af95d4644cd5d498345a26c8f1a2cf --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7lc" +{ +} + diff --git a/fanuc_lrmate200id7lc/payloads/Physics/physics.usda b/fanuc_lrmate200id7lc/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..7956e7f2343235d041bb01e94e3b7e8e5d3367d7 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7lc" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 600 + float drive:angular:physics:stiffness = 2500 + 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.47021022 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 600 + float drive:angular:physics:stiffness = 2500 + 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.5096806 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 300 + float drive:angular:physics:stiffness = 2500 + 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 = 1.6409131 + point3f physics:localPos0 = (0, 0, 0.44) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 212.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.47302175 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 40 + float drive:angular:physics:stiffness = 2500 + 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.14094704 + point3f physics:localPos0 = (0.42, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.00020373959 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.0146, -0.00034199998, 0.07959999) + float3 physics:diagonalInertia = (0.023932816, 0.029343205, 0.030923985) + float physics:mass = 5.08 + quatf physics:principalAxes = (0.9975047, 0.045144677, 0.021711404, 0.049748786) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.042427637, 0.02912066, 0.028451703) + float physics:mass = 5.4 + quatf physics:principalAxes = (0.97314996, 0.08607831, 0.2125431, -0.019879077) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00311, -0.00124, 0.217) + float3 physics:diagonalInertia = (0.28000233, 0.25401852, 0.050879233) + float physics:mass = 10.9 + quatf physics:principalAxes = (0.99998724, -0.0047763293, -0.0015629162, 0.0004972085) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.005291147, 0.00638231, 0.0067365426) + float physics:mass = 2.07 + quatf physics:principalAxes = (0.96989906, 0.018646862, -0.24056207, 0.03283329) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.266, 0.00354, 0.00226) + float3 physics:diagonalInertia = (0.005099964, 0.03459043, 0.03460961) + float physics:mass = 3.07 + quatf physics:principalAxes = (0.9240465, 0.38227966, 0.00054814486, -0.000058205245) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0236, 0.00233, -0.00000699) + float3 physics:diagonalInertia = (0.00037472052, 0.0007542795, 0.000712) + float physics:mass = 0.482 + quatf physics:principalAxes = (0.9995781, -0.00033998486, -0.00002166772, -0.029042235) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0836, -3.2399998e-19, -1.22e-18) + float3 physics:diagonalInertia = (0.00000485, 0.00000285, 0.00000285) + float physics:mass = 0.0202 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id7lc/payloads/Physics/physx.usda b/fanuc_lrmate200id7lc/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..8359d0d6e27f8fa36ed1ec647613c8a064908cdd --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id7lc" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 370 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 309.99997 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id7lc/payloads/Sensor/none.usda b/fanuc_lrmate200id7lc/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..eddcf42d47af95d4644cd5d498345a26c8f1a2cf --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7lc" +{ +} + diff --git a/fanuc_lrmate200id7lc/payloads/Sensor/sensors.usda b/fanuc_lrmate200id7lc/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..b09ae0a9307476b8cfb8e0bc0dfe13f4d65d64a9 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7lc" +{ +} + diff --git a/fanuc_lrmate200id7lc/payloads/base.usda b/fanuc_lrmate200id7lc/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..4d15eb2872730a21f89d104c500cd6ac36f65bc4 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id7lc" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.7699999809265137) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.4699999988079071, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.4699999988079071, 0, 0.8050000071525574) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.09000000357627869, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7lc/payloads/geometries.usd b/fanuc_lrmate200id7lc/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..2b8cbf9716e8236ef699f7022cfac632347e3048 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:741d09f2a32a4a98547babb131f7ccdccee205cd70b6f7bd63e0fca30b965906 +size 6696912 diff --git a/fanuc_lrmate200id7lc/payloads/instances.usda b/fanuc_lrmate200id7lc/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..4b2086c7fb1a1fd982cb982ba2cc2f5db7c5e7c2 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/instances.usda @@ -0,0 +1,835 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.4980392, 0.4980392, 0.4980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_2" ( + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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 "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_3" ( + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.6980392, 0.6980392, 0.6980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_5" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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 = 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 "Material_7" ( + 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 = 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 "Material_1" ( + 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 = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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_7" ( + 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 = 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 "mesh_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + uniform token purpose = "guide" + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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/fanuc_lrmate200id7lc/payloads/materials.usda b/fanuc_lrmate200id7lc/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..54004b08d383993564c405eb84c0b4e1334ca1c7 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/materials.usda @@ -0,0 +1,1285 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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.4980392, 0.4980392, 0.4980392) ( + 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.4980392, 0.4980392, 0.4980392) + 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_1" + { + 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_1" ( + 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_2" + { + 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_0" ( + 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_3" + { + 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_0" ( + 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_4" + { + 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_1" ( + 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.6980392, 0.6980392, 0.6980392) ( + 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.6980392, 0.6980392, 0.6980392) + 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_5" + { + 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_2" ( + 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.8000001, 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.8000001, 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_6" + { + 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_0" ( + 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:metallic_constant = 1 + 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 = 1 + 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_7" + { + 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_1" ( + 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:metallic_constant = 1 + 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 = 1 + 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/fanuc_lrmate200id7lc/payloads/robot.usda b/fanuc_lrmate200id7lc/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..39071c8d388658d896490dff7c9ed0257c4fa031 --- /dev/null +++ b/fanuc_lrmate200id7lc/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7lc" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id7lc/runnables/physics/mujoco.usda b/fanuc_lrmate200id7lc/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..6cf118d8e280d218ddb1fc2956f93058ea72397a --- /dev/null +++ b/fanuc_lrmate200id7lc/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7lc" +) + +def "lrmate200id7lc" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id7lc_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 600 + double mjc:forceRange:min = -600 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7lc_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 600 + double mjc:forceRange:min = -600 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7lc_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 300 + double mjc:forceRange:min = -300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7lc_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7lc_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 40 + double mjc:forceRange:min = -40 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7lc_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_lrmate200id7lc/runnables/physics/newton.usda b/fanuc_lrmate200id7lc/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..59545195a430caefacf1ef501ff99cad0ec3d72c --- /dev/null +++ b/fanuc_lrmate200id7lc/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7lc" +) + +over "lrmate200id7lc" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 60.8108 + float newton:damping = 2.027027 + float newton:velocityLimit = 370 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 72.5806 + float newton:damping = 2.419355 + float newton:velocityLimit = 309.99997 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 27.439 + float newton:damping = 0.914634 + float newton:velocityLimit = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.7727 + float newton:damping = 0.159091 + float newton:velocityLimit = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.7523 + float newton:damping = 0.091743 + float newton:velocityLimit = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.75 + float newton:damping = 0.025 + float newton:velocityLimit = 999.99994 + } + } +} + diff --git a/fanuc_lrmate200id7lc/runnables/physics/physx.usda b/fanuc_lrmate200id7lc/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..d01c3ad713abf9f68cfba801a003b57086f8e274 --- /dev/null +++ b/fanuc_lrmate200id7lc/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7lc" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7lc" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 370 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 309.99997 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} + diff --git a/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json b/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.json new file mode 100644 index 0000000000000000000000000000000000000000..142f027218c45ad8c08511c362aed1fa3d058b69 --- /dev/null +++ b/fanuc_lrmate200id7we/.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:16", + "assets": [ + { + "asset": "lrmate200id7we.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/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.packaging.bom.json b/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.packaging.bom.json new file mode 100644 index 0000000000000000000000000000000000000000..c0baef0657cacdde5cb8d11334857e8c637baf0f --- /dev/null +++ b/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.packaging.bom.json @@ -0,0 +1,214 @@ +{ + "format_version": "1.0", + "items": [ + { + "relative_path": ".simready/validation.json", + "size": 7545, + "hash": { + "sha256-flat-1mb": "6ba959657ebe5029b98529867c7946e518e08513360f7be7a38ee3c7f055377b", + "sha256": "a8689352e668e642b8c43cba339b0c0270a5ce45b614cf83dcf1370b4efd7c56" + } + }, + { + "relative_path": ".thumbs/256x256/.lrmate200id7we.usda.last_generated", + "size": 19, + "hash": { + "sha256-flat-1mb": "7651936ecc7c14b3940bebea6d97f04cc23c64c15204a96713b12fd2a0fcfeff", + "sha256": "309d7c1282273d76034b51c98b575a446fd622f952b8a672cdbfc10f91f9316f" + } + }, + { + "relative_path": ".thumbs/256x256/lrmate200id7we.usda.png", + "size": 43656, + "hash": { + "sha256-flat-1mb": "1efb7b0eee0cc20162f7b3c1440ad6ee56e52002b31c59414aeaf9e73442d31a", + "sha256": "81d528a2288076c35f03dcb4705f952b55b52bc63cdc0d464fdd716d8ce004d3" + } + }, + { + "relative_path": ".thumbs/lrmate200id7we.thumb.usd", + "size": 6130, + "hash": { + "sha256-flat-1mb": "7e76a533970aa6ec490fc69c80d5ef5e4159f160dfebabd7781d4b418c65feae", + "sha256": "f31be1fe6c113e3b05d17a167e7d6c40b6b8bcef4ecd6d181ec2800b28b96e47" + } + }, + { + "relative_path": "lrmate200id7we.usda", + "size": 16041, + "hash": { + "sha256-flat-1mb": "d2b95048f667095e4468e303cb832de6b2d212e438d8ba525a85bd81dc60e1d1", + "sha256": "7800ed5ef6b0f17ef2ba612b962f44d47c361119294bb00b09e7338355e94d52" + } + }, + { + "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": 2922, + "hash": { + "sha256-flat-1mb": "ef1421efda4ce1503c53c57df0a0fce9f6f4eb094be0115422202a0b01f06a1c", + "sha256": "57d7e45bf003e4bfbc5354e884afc7506370fc1c1b0dcfe2da8b04c44a2823ab" + } + }, + { + "relative_path": "payloads/Physics/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "809dffc6d9c975fed453db9994820525c6b0286905a4f9b7c96df4d9ec7d4b6d", + "sha256": "b7de1cfe3a50174c601cc42752ef913aacf6c300455414937e651cf98462e1ec" + } + }, + { + "relative_path": "payloads/Physics/physics.usda", + "size": 12109, + "hash": { + "sha256-flat-1mb": "4279b2877994a50457a989ef97047cb3519cca4ef7c186bc2c975a713e7b742d", + "sha256": "ae8fc991c447683ece1c685969d7539f9ac6fe729d15d41e12d3bbd4603252aa" + } + }, + { + "relative_path": "payloads/Physics/physx.usda", + "size": 1458, + "hash": { + "sha256-flat-1mb": "faf3a9234ec5609993b16b3972639340e1c59db80161d072e1d36666c1b50e5b", + "sha256": "41684e0aebb532bca9ebbc659e519355551060b1335418e85c677f07ffe73976" + } + }, + { + "relative_path": "payloads/Sensor/none.usda", + "size": 145, + "hash": { + "sha256-flat-1mb": "809dffc6d9c975fed453db9994820525c6b0286905a4f9b7c96df4d9ec7d4b6d", + "sha256": "b7de1cfe3a50174c601cc42752ef913aacf6c300455414937e651cf98462e1ec" + } + }, + { + "relative_path": "payloads/Sensor/sensors.usda", + "size": 151, + "hash": { + "sha256-flat-1mb": "0b812552011f06ae7910b8908df9bcda0e49f94ebc0d16800f90ff3cd1b5527f", + "sha256": "833bb637ad24cd10d6c60e80481ae13e3a1395a806f5fdc532cb5a4dc89d4884" + } + }, + { + "relative_path": "payloads/base.usda", + "size": 11561, + "hash": { + "sha256-flat-1mb": "2ddc96334a8ee571716a61cc56129180c3b87acc485a79ed5f914f3e9d9a5ecd", + "sha256": "04d3e16dee9266ec953dbbca1c942b98da63cb3c474f6c873cc221fd530743a0" + } + }, + { + "relative_path": "payloads/geometries.usd", + "size": 7089980, + "hash": { + "sha256-flat-1mb": "a0452dd5b5e506330dd303d12e1f42f0f92e1a7be6412344ec40526104277b3b", + "sha256": "16b9e9b0641343fe991c1838287b6ea708c7cae125f4b2d11e05501635a2d27c", + "sha256-first1m": "c5022724c393fbf0fa51f186208a8a4efb0be59e2c9917a97e6b9049a497c374" + } + }, + { + "relative_path": "payloads/instances.usda", + "size": 32374, + "hash": { + "sha256-flat-1mb": "81751386d5ea4fa84e1b8eea68852eb7691fb2e7824cde2c73a82d3ee60c8770", + "sha256": "21939fb811f3382707a1cb4ac229df6fd1bd4c58db41a9758b48472177045045" + } + }, + { + "relative_path": "payloads/materials.usda", + "size": 61570, + "hash": { + "sha256-flat-1mb": "c9e3dd6c39eaf9481f785856f6b30c3e3a71a521d9438b3031b427592b7af5d7", + "sha256": "e8c82188050355acab7d0821f90d8aa8521e9c698599134822b9a2a8e0dc01a5" + } + }, + { + "relative_path": "payloads/robot.usda", + "size": 3025, + "hash": { + "sha256-flat-1mb": "780c18a1e1f19a4c207fc8076c7173dc21809c0d97c3d79038f9289e7a389e4e", + "sha256": "6f2bd70c8d6d01df751f7c01dcf4d829666818544bbe4358b29176be1fec133c" + } + }, + { + "relative_path": "runnables/physics/mujoco.usda", + "size": 8232, + "hash": { + "sha256-flat-1mb": "00c7636c1223b239343ed262711ee2069c014884517206fe2fe6a592d38f03fc", + "sha256": "5c2e1a359eb2fb4b89b34d12cb3f4e532ce16a58134b42bcf405278d6795943c" + } + }, + { + "relative_path": "runnables/physics/newton.usda", + "size": 4919, + "hash": { + "sha256-flat-1mb": "b8087afa182d67af63ae1fb9d9e21e91daf4fb4074e353d197e58538ff7c3576", + "sha256": "654a50ddc26aea44656dd54cc291ceca23788b4a70ef0ce3ad63c5672e01f5d8" + } + }, + { + "relative_path": "runnables/physics/physx.usda", + "size": 3548, + "hash": { + "sha256-flat-1mb": "945068c1d885690d424c2eaba0b5fb6e7bca6d3ed41d8a70903e1cd87a1da7c6", + "sha256": "50c8065211bc4c74924c497965508306396ae01a3c1163eadd85fc1169bf3963" + } + } + ] +} \ No newline at end of file diff --git a/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.root_usds.json b/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.root_usds.json new file mode 100644 index 0000000000000000000000000000000000000000..7048b1735d64a5d9214845ad56edeee8db86f9af --- /dev/null +++ b/fanuc_lrmate200id7we/.metadata/com.nvidia.simready.root_usds.json @@ -0,0 +1,6 @@ +{ + "format_version": "1.0", + "entries": [ + "lrmate200id7we.usda" + ] +} diff --git a/fanuc_lrmate200id7we/.metadata/license.txt b/fanuc_lrmate200id7we/.metadata/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..da6ab6cc8f333d7e89a99812866df8f24374d47c --- /dev/null +++ b/fanuc_lrmate200id7we/.metadata/license.txt @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/fanuc_lrmate200id7we/.simready/validation.json b/fanuc_lrmate200id7we/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ab69b310886bd9bc5b35c3d6f829fb7cbecc45 --- /dev/null +++ b/fanuc_lrmate200id7we/.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/fanuc_lrmate200id7we/.thumbs/256x256/.lrmate200id7we.usda.last_generated b/fanuc_lrmate200id7we/.thumbs/256x256/.lrmate200id7we.usda.last_generated new file mode 100644 index 0000000000000000000000000000000000000000..97297fa9ba07886964eab0ecea967b2dc0dc9430 --- /dev/null +++ b/fanuc_lrmate200id7we/.thumbs/256x256/.lrmate200id7we.usda.last_generated @@ -0,0 +1 @@ +2026-08-11 03:29:08 \ No newline at end of file diff --git a/fanuc_lrmate200id7we/.thumbs/256x256/lrmate200id7we.usda.png b/fanuc_lrmate200id7we/.thumbs/256x256/lrmate200id7we.usda.png new file mode 100644 index 0000000000000000000000000000000000000000..a51da82c03d88de8802bc57236fb21a94aaea6f4 --- /dev/null +++ b/fanuc_lrmate200id7we/.thumbs/256x256/lrmate200id7we.usda.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81d528a2288076c35f03dcb4705f952b55b52bc63cdc0d464fdd716d8ce004d3 +size 43656 diff --git a/fanuc_lrmate200id7we/.thumbs/lrmate200id7we.thumb.usd b/fanuc_lrmate200id7we/.thumbs/lrmate200id7we.thumb.usd new file mode 100644 index 0000000000000000000000000000000000000000..50849af2d34ee27ac355091b4752abf9fa582271 Binary files /dev/null and b/fanuc_lrmate200id7we/.thumbs/lrmate200id7we.thumb.usd differ diff --git a/fanuc_lrmate200id7we/com.nvidia.simready.packaging.json b/fanuc_lrmate200id7we/com.nvidia.simready.packaging.json new file mode 100644 index 0000000000000000000000000000000000000000..36af9b87591eb3c33b1b115c15bcea4a571ceca4 --- /dev/null +++ b/fanuc_lrmate200id7we/com.nvidia.simready.packaging.json @@ -0,0 +1,37 @@ +{ + "format_version": "1.0", + "package_id": "fanuc_lrmate200id7we.1.0.0", + "license": "CC-BY-4.0", + "metadata": [ + { + "name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json", + "hash": { + "sha256": "bf850016c2639ba0dc82d9ce592901aa6827729737b922b09f4e04328a304216" + } + }, + { + "name": "com.nvidia.simready.packaging.bom.json", + "hash": { + "sha256": "1ad76de2802d3f54ffd59a3d669cec960ee923c9fa62cd9a0ad055586a242e51" + } + }, + { + "name": "com.nvidia.simready.root_usds.json", + "hash": { + "sha256": "05491dbcb6fe63ada47c4980397be4188144af663e5604318ee80c26f21dc0d8" + } + }, + { + "name": "license.txt", + "hash": { + "sha256": "9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411" + } + } + ], + "content_hash": { + "sha256": "7e35a1b1cf8fb7b2da0ebd9adc70fcf42ee8688892052f2932f3830a529654ec" + }, + "package_hash": { + "sha256": "37321acbe5eebd3d8c5af781dbf05bb405930e69408154763c0ee9f174053c63" + } +} diff --git a/fanuc_lrmate200id7we/lrmate200id7we.usda b/fanuc_lrmate200id7we/lrmate200id7we.usda new file mode 100644 index 0000000000000000000000000000000000000000..c9237c4bd1db2105dfbd10c6d251062a908ff1ff --- /dev/null +++ b/fanuc_lrmate200id7we/lrmate200id7we.usda @@ -0,0 +1,420 @@ +#usda 1.0 +( + customLayerData = { + dictionary SimReady_Metadata = { + dictionary Variants = { + dictionary Physics = { + dictionary MuJoCo = { + string activateOption = "Enabled" + string prim = "/lrmate200id7we" + string variantSetName = "MuJoCo" + } + dictionary Newton = { + string activateOption = "Enabled" + string prim = "/lrmate200id7we" + string variantSetName = "Newton" + } + dictionary PhysX = { + string activateOption = "Enabled" + string prim = "/lrmate200id7we" + 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.6264005, 0.23500204, 0.75890136) + string asset_license = "CC-BY-4.0" + string asset_name = "lrmate200id7we" + string asset_type = "robot" + string author = "Fanuc" + string category = "robotic arm" + double mass = 27.00139951147139 + string qcode = "Q40687" + int rigid_body_count = 7 + string source_file = "Fanuc/lrmate200id7we/lrmate200id7we.usda" + string usd_date_generated = "2026-10-02" + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7we" ( + kind = "component" + prepend references = [ + @./payloads/Physics/physics.usda@, + @./payloads/base.usda@ + ] + variants = { + string MuJoCo = "Disabled" + string Newton = "Disabled" + string PhysX = "Disabled" + string Sensor = "none" + } + variantSets = ["Sensor", "PhysX", "Newton", "MuJoCo"] +) +{ + color3f[] primvars:displayColor = [(0.5, 0.5, 0.5)] ( + interpolation = "constant" + ) + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" + { + token visibility = "invisible" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" + { + token visibility = "invisible" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" + { + token visibility = "invisible" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" + { + token visibility = "invisible" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" + { + token visibility = "invisible" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" + { + token visibility = "invisible" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" + { + token visibility = "invisible" + } + } + } + } + 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/fanuc_lrmate200id7we/materials/mdl/LICENSE.md b/fanuc_lrmate200id7we/materials/mdl/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a571d2b4f4cfc3d48ff2ca421fc8c950cc1fce --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/materials/mdl/OmniPBR.mdl b/fanuc_lrmate200id7we/materials/mdl/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bcd0685466a09006ac9e009969d32de43d6d04d9 --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/materials/mdl/OmniPBRBase.mdl b/fanuc_lrmate200id7we/materials/mdl/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/materials/mdl/OmniPBR_ClearCoat.mdl b/fanuc_lrmate200id7we/materials/mdl/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7a2e7e1f06d0708ba56f84998d14b41fdaccf29a --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/materials/mdl/aux_definitions.mdl b/fanuc_lrmate200id7we/materials/mdl/aux_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ceafd716af19521a4733704808ebcc07613217e1 --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/materials/mdl/core_definitions.mdl b/fanuc_lrmate200id7we/materials/mdl/core_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbe3f174c2da2abe2b6aa211510de9128848089c --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/materials/mdl/support_definitions.mdl b/fanuc_lrmate200id7we/materials/mdl/support_definitions.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8fc835d19c6caa5cad15c8f472ad074645017c9f --- /dev/null +++ b/fanuc_lrmate200id7we/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/fanuc_lrmate200id7we/payloads/Physics/mujoco.usda b/fanuc_lrmate200id7we/payloads/Physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..d72b62453a3d0ec006d2e398d7452e4bad9ad469 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/Physics/mujoco.usda @@ -0,0 +1,199 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7we" +{ + over "joints" + { + over "J1" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J2" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J3" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J4" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J5" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + + over "J6" ( + delete apiSchemas = ["PhysicsJointStateAPI:angular", "PhysicsDriveAPI:angular"] + ) + { + } + } + + over "robot_base" + { + over "base_link" + { + over "wbase" + { + } + } + + over "visuals" + { + over "base" + { + } + } + + over "collisions" + { + over "base" + { + } + } + } + + over "J1_link" + { + over "visuals" + { + over "j1" + { + } + } + + over "collisions" + { + over "j1" + { + } + } + } + + over "J2_link" + { + over "visuals" + { + over "j2" + { + } + } + + over "collisions" + { + over "j2" + { + } + } + } + + over "J3_link" + { + over "visuals" + { + over "j3" + { + } + } + + over "collisions" + { + over "j3" + { + } + } + } + + over "J4_link" + { + over "visuals" + { + over "j4" + { + } + } + + over "collisions" + { + over "j4" + { + } + } + } + + over "J5_link" + { + over "visuals" + { + over "j5" + { + } + } + + over "collisions" + { + over "j5" + { + } + } + } + + over "J6_link" + { + over "flange" + { + over "ee_link" + { + } + + over "fanuc_flange" + { + } + } + + over "visuals" + { + over "j6" + { + } + } + + over "collisions" + { + over "j6" + { + } + } + } + + over "root_joint" + { + } + + over "Looks" + { + } + + over "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7we/payloads/Physics/none.usda b/fanuc_lrmate200id7we/payloads/Physics/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..19b4f0a2667f1298adf88d3777da406770791da4 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/Physics/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7we" +{ +} + diff --git a/fanuc_lrmate200id7we/payloads/Physics/physics.usda b/fanuc_lrmate200id7we/payloads/Physics/physics.usda new file mode 100644 index 0000000000000000000000000000000000000000..465a9cd644216edca984cbcbb645c05eb813a455 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/Physics/physics.usda @@ -0,0 +1,335 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7we" +{ + over "joints" + { + def PhysicsRevoluteJoint "J1" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 500 + float drive:angular:physics:stiffness = 2500 + 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.5342988 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (1, 0, 0, 0) + quatf physics:localRot1 = (1, 0, 0, 0) + float physics:lowerLimit = -180 + float physics:upperLimit = 180 + } + + def PhysicsRevoluteJoint "J2" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 500 + float drive:angular:physics:stiffness = 2500 + 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.5130542 + point3f physics:localPos0 = (0.05, 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 = -99.99999 + float physics:upperLimit = 144.99998 + } + + def PhysicsRevoluteJoint "J3" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 300 + float drive:angular:physics:stiffness = 2500 + 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.98503 + point3f physics:localPos0 = (0, 0, 0.33) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -69.99999 + float physics:upperLimit = 204.99998 + } + + def PhysicsRevoluteJoint "J4" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 70 + float drive:angular:physics:stiffness = 2500 + 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.28648242 + point3f physics:localPos0 = (0, 0, 0.035) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -190 + float physics:upperLimit = 190 + } + + def PhysicsRevoluteJoint "J5" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 40 + float drive:angular:physics:stiffness = 2500 + 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.087419055 + point3f physics:localPos0 = (0.335, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 1, 0, 0) + quatf physics:localRot1 = (0, 1, 0, 0) + float physics:lowerLimit = -124.99999 + float physics:upperLimit = 124.99999 + } + + def PhysicsRevoluteJoint "J6" ( + prepend apiSchemas = ["PhysicsDriveAPI:angular", "PhysicsJointStateAPI:angular"] + ) + { + float drive:angular:physics:damping = 100 + float drive:angular:physics:maxForce = 20 + float drive:angular:physics:stiffness = 2500 + 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.000113873175 + point3f physics:localPos0 = (0, 0, 0) + point3f physics:localPos1 = (0, 0, 0) + quatf physics:localRot0 = (0, 0, 0, 1) + quatf physics:localRot1 = (0, 0, 0, 1) + float physics:lowerLimit = -360 + float physics:upperLimit = 360 + } + } + + over "robot_base" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.019, -0.000897, 0.0796) + float3 physics:diagonalInertia = (0.027378803, 0.03619962, 0.037921574) + float physics:mass = 5.89 + quatf physics:principalAxes = (0.9973426, 0.043915506, 0.016107297, 0.055856228) + rel physics:simulationOwner + + over "collisions" + { + over "base" ( + instanceable = false + ) + { + over "mesh_1" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J1_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0287, 0.000102, -0.0547) + float3 physics:diagonalInertia = (0.047406346, 0.0325227, 0.031770952) + float physics:mass = 6.03 + quatf physics:principalAxes = (0.97332203, 0.08511111, 0.21216847, -0.019619156) + rel physics:simulationOwner + + over "collisions" + { + over "j1" ( + instanceable = false + ) + { + over "mesh_3" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J2_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (-0.00271, -0.000976, 0.159) + float3 physics:diagonalInertia = (0.17000026, 0.1460134, 0.045886334) + float physics:mass = 9.69 + quatf physics:principalAxes = (0.9999827, -0.0057938322, -0.0006622284, 0.0007122755) + rel physics:simulationOwner + + over "collisions" + { + over "j2" ( + instanceable = false + ) + { + over "mesh_5" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J3_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.00887, -0.0000626, 0.0171) + float3 physics:diagonalInertia = (0.0059048007, 0.007132521, 0.007522677) + float physics:mass = 2.31 + quatf physics:principalAxes = (0.9700464, 0.019145258, -0.23994799, 0.03268747) + rel physics:simulationOwner + + over "collisions" + { + over "j3" ( + instanceable = false + ) + { + over "mesh_7" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J4_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.223, 0.00356, 0.00215) + float3 physics:diagonalInertia = (0.004229572, 0.018290114, 0.018310316) + float physics:mass = 2.59 + quatf physics:principalAxes = (0.92590946, 0.37773535, 0.0025487433, -0.0010526342) + rel physics:simulationOwner + + over "collisions" + { + over "j4" ( + instanceable = false + ) + { + over "mesh_9" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J5_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.0177, 0.0025, -0.00000419) + float3 physics:diagonalInertia = (0.00036158366, 0.0006454164, 0.000603) + float physics:mass = 0.477 + quatf physics:principalAxes = (0.9993753, -0.00023640158, -0.000035251836, -0.03534234) + rel physics:simulationOwner + + over "collisions" + { + over "j5" ( + instanceable = false + ) + { + over "mesh_11" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + over "J6_link" ( + prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"] + ) + { + point3f physics:centerOfMass = (0.07399999, 2.26e-18, 3.35e-18) + float3 physics:diagonalInertia = (0.00000295, 0.00000164, 0.00000164) + float physics:mass = 0.0144 + quatf physics:principalAxes = (1, 0, 0, 0) + rel physics:simulationOwner + + over "collisions" + { + over "j6" ( + instanceable = false + ) + { + over "mesh_13" ( + prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + } + } + } + } + + def PhysicsFixedJoint "root_joint" ( + prepend apiSchemas = ["PhysicsArticulationRootAPI"] + ) + { + rel physics:body1 = + } +} + diff --git a/fanuc_lrmate200id7we/payloads/Physics/physx.usda b/fanuc_lrmate200id7we/payloads/Physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..81ffdcc674b0b0ab789016bf03f6c1e983480281 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/Physics/physx.usda @@ -0,0 +1,69 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + subLayers = [ + @./physics.usda@ + ] + upAxis = "Z" +) + +def "lrmate200id7we" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 380 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } +} + diff --git a/fanuc_lrmate200id7we/payloads/Sensor/none.usda b/fanuc_lrmate200id7we/payloads/Sensor/none.usda new file mode 100644 index 0000000000000000000000000000000000000000..19b4f0a2667f1298adf88d3777da406770791da4 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/Sensor/none.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +def "lrmate200id7we" +{ +} + diff --git a/fanuc_lrmate200id7we/payloads/Sensor/sensors.usda b/fanuc_lrmate200id7we/payloads/Sensor/sensors.usda new file mode 100644 index 0000000000000000000000000000000000000000..a860a091db95abb41eaa236a9986b051ce19497d --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/Sensor/sensors.usda @@ -0,0 +1,13 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +def Xform "lrmate200id7we" +{ +} + diff --git a/fanuc_lrmate200id7we/payloads/base.usda b/fanuc_lrmate200id7we/payloads/base.usda new file mode 100644 index 0000000000000000000000000000000000000000..54a39ee15d08b4686d5e8288442b6df01a2f2387 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/base.usda @@ -0,0 +1,366 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + subLayers = [ + @./robot.usda@ + ] + upAxis = "Z" +) + +def Xform "lrmate200id7we" +{ + 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 Scope "joints" + { + } + + def Xform "robot_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 "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 "wbase" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } + } + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "base" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J1_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j1" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j1" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J2_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.33000001311302185) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j2" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j2" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J3_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6600000262260437) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j3" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j3" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J4_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.05000000074505806, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j4" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j4" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J5_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "visuals" ( + instanceable = false + ) + { + def Xform "j5" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j5" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Xform "J6_link" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.3850000202655792, 0, 0.6950000524520874) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "flange" + { + quatd xformOp:orient = (1, 0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0.07999999821186066, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def Xform "ee_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 "fanuc_flange" + { + quatd xformOp:orient = (-3.0908619663705394e-8, 0.7071067690849304, 3.0908619663705394e-8, 0.7071067690849304) + 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 "j6" ( + 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" ( + apiSchemas = None + instanceable = false + ) + { + rel physics:simulationOwner + + def Xform "j6" ( + instanceable = true + prepend references = @./instances.usda@ + ) + { + uniform token purpose = "guide" + token visibility = "inherited" + } + } + } + + def Scope "VisualMaterials" + { + } +} + diff --git a/fanuc_lrmate200id7we/payloads/geometries.usd b/fanuc_lrmate200id7we/payloads/geometries.usd new file mode 100644 index 0000000000000000000000000000000000000000..4f57c1a89896ed8708d8560c1915e82cbe18e216 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/geometries.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16b9e9b0641343fe991c1838287b6ea708c7cae125f4b2d11e05501635a2d27c +size 7089980 diff --git a/fanuc_lrmate200id7we/payloads/instances.usda b/fanuc_lrmate200id7we/payloads/instances.usda new file mode 100644 index 0000000000000000000000000000000000000000..7c147b0762c348730aa9ecabbb9ba8dcd653f1f4 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/instances.usda @@ -0,0 +1,934 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Instances" +{ + def Xform "mesh" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_0" ( + 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 = 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 "Material_1" ( + 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.96 + float inputs:opacity = 1 + 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_2" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.5058824, 0.5294118, 0.5490196) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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 = ["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 "Material_1" ( + 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.96 + float inputs:opacity = 1 + 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 = ["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 "Material_1" ( + 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.96 + float inputs:opacity = 1 + 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 = ["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 "Material_1" ( + 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.96 + float inputs:opacity = 1 + 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 = ["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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_1" ( + 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.96 + float inputs:opacity = 1 + 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_3" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.6980392, 0.6980392, 0.6980392) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_4" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.8000001, 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_5" ( + 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_9" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_3" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_6" ( + 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 = 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 "Material_0" ( + 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 = 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 "Material_7" ( + 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_8" ( + 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 = 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 "mesh_11" ( + 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" + { + over "Material_0" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_1" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + + over "Material_2" ( + apiSchemas = ["MaterialBindingAPI"] + ) + { + custom rel material:binding + prepend rel material:binding = + } + } + + def Scope "VisualMaterials" + { + def Material "Material_9" ( + instanceable = true + prepend references = @./materials.usda@ + ) + { + token outputs:surface.connect = + + def Shader "SimReadyPreviewSurface" + { + token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.7333333, 0.7333333, 0.7333333) + float inputs:metallic = 0 + float inputs:opacity = 1 + 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_10" ( + 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_11" ( + 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_13" ( + prepend references = @./geometries.usd@ + ) + { + over "mesh_13" ( + 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 + } + } + } + } +} + diff --git a/fanuc_lrmate200id7we/payloads/materials.usda b/fanuc_lrmate200id7we/payloads/materials.usda new file mode 100644 index 0000000000000000000000000000000000000000..4ad79b3b22b8878ce0df5e0f9545e11763a265b7 --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/materials.usda @@ -0,0 +1,1763 @@ +#usda 1.0 +( + customLayerData = { + } + metersPerUnit = 1 + upAxis = "Z" +) + +def Scope "Materials" +{ + def Material "Material_0" + { + 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_0" ( + 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:metallic_constant = 1 + 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 = 1 + 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_1" + { + 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_1" ( + 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:metallic_constant = 0.96 + 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.96 + 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_2" + { + 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_2" ( + 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.5058824, 0.5294118, 0.5490196) ( + 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.5058824, 0.5294118, 0.5490196) + 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" + { + 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_3" + { + 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_1" ( + 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.6980392, 0.6980392, 0.6980392) ( + 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.6980392, 0.6980392, 0.6980392) + 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_4" + { + 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_2" ( + 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.8000001, 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.8000001, 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_5" + { + 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_3" ( + 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_7" + { + 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_2" ( + 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_8" + { + 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_3" ( + 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:metallic_constant = 1 + 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 = 1 + 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_9" + { + 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_0" ( + 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.7333333, 0.7333333, 0.7333333) ( + 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.7333333, 0.7333333, 0.7333333) + 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_10" + { + 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_1" ( + 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 + } + } +} + diff --git a/fanuc_lrmate200id7we/payloads/robot.usda b/fanuc_lrmate200id7we/payloads/robot.usda new file mode 100644 index 0000000000000000000000000000000000000000..4af8a3c9a6444970ff2d38382e4ca25ca5ef092f --- /dev/null +++ b/fanuc_lrmate200id7we/payloads/robot.usda @@ -0,0 +1,154 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7we" ( + 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 "joints" + { + over "J1" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } + } + + over "robot_base" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J1_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J2_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J3_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J4_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J5_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "J6_link" ( + prepend apiSchemas = ["IsaacLinkAPI"] + ) + { + string isaac:nameOverride + } + + over "root_joint" ( + prepend apiSchemas = ["IsaacJointAPI"] + ) + { + } +} + diff --git a/fanuc_lrmate200id7we/runnables/physics/mujoco.usda b/fanuc_lrmate200id7we/runnables/physics/mujoco.usda new file mode 100644 index 0000000000000000000000000000000000000000..5ff153193b044c120486619d43af3cb7fae5a783 --- /dev/null +++ b/fanuc_lrmate200id7we/runnables/physics/mujoco.usda @@ -0,0 +1,252 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7we" +) + +def "lrmate200id7we" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + prepend apiSchemas = ["MjcCollisionAPI", "PhysicsMeshCollisionAPI", "MjcMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "joints" + { + over "J1" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J2" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J3" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J4" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J5" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + + over "J6" ( + prepend apiSchemas = ["MjcJointAPI"] + ) + { + } + } + + def "MuJoCoActuators" + { + def MjcActuator "act_lrmate200id7we_joints_J1" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 500 + double mjc:forceRange:min = -500 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7we_joints_J2" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 500 + double mjc:forceRange:min = -500 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7we_joints_J3" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 300 + double mjc:forceRange:min = -300 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7we_joints_J4" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 70 + double mjc:forceRange:min = -70 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7we_joints_J5" ( + 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, -143239.44878270582, -5729.5779513082325] + token mjc:biasType = "affine" + token mjc:ctrlLimited = "false" + token mjc:forceLimited = "true" + double mjc:forceRange:max = 40 + double mjc:forceRange:min = -40 + double[] mjc:gainPrm = [1] + token mjc:gainType = "fixed" + rel mjc:target = + } + + def MjcActuator "act_lrmate200id7we_joints_J6" ( + 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, -143239.44878270582, -5729.5779513082325] + 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/fanuc_lrmate200id7we/runnables/physics/newton.usda b/fanuc_lrmate200id7we/runnables/physics/newton.usda new file mode 100644 index 0000000000000000000000000000000000000000..d8d699e72255afe6d58786d350471e1ab51c9022 --- /dev/null +++ b/fanuc_lrmate200id7we/runnables/physics/newton.usda @@ -0,0 +1,190 @@ +#usda 1.0 +( + defaultPrim = "lrmate200id7we" +) + +over "lrmate200id7we" +{ + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + prepend apiSchemas = ["NewtonCollisionAPI", "NewtonMeshCollisionAPI", "PhysicsMeshCollisionAPI"] + ) + { + uniform token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + 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 "J1" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 41.6667 + float newton:damping = 1.388889 + float newton:velocityLimit = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 49.3421 + float newton:damping = 1.644737 + float newton:velocityLimit = 380 + } + + over "J3" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 27.439 + float newton:damping = 0.914634 + float newton:velocityLimit = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 4.7727 + float newton:damping = 0.159091 + float newton:velocityLimit = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 2.7523 + float newton:damping = 0.091743 + float newton:velocityLimit = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["NewtonJointAPI"] + ) + { + float drive:angular:physics:damping = 0 + float drive:angular:physics:stiffness = 0.75 + float newton:damping = 0.025 + float newton:velocityLimit = 999.99994 + } + } +} + diff --git a/fanuc_lrmate200id7we/runnables/physics/physx.usda b/fanuc_lrmate200id7we/runnables/physics/physx.usda new file mode 100644 index 0000000000000000000000000000000000000000..1946686f1f7028087c97358e6cd8f1eac1404864 --- /dev/null +++ b/fanuc_lrmate200id7we/runnables/physics/physx.usda @@ -0,0 +1,171 @@ +#usda 1.0 +( + customLayerData = { + } + defaultPrim = "lrmate200id7we" + metersPerUnit = 1 + upAxis = "Z" +) + +over "lrmate200id7we" +{ + over "joints" + { + over "J1" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 449.99997 + } + + over "J2" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 380 + } + + over "J3" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 409.99997 + } + + over "J4" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 549.99994 + } + + over "J5" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 544.99994 + } + + over "J6" ( + prepend apiSchemas = ["PhysxJointAPI", "PhysicsJointStateAPI:angular"] + ) + { + float physxJoint:maxJointVelocity = 999.99994 + } + } + + over "root_joint" ( + prepend apiSchemas = ["PhysxArticulationAPI"] + ) + { + bool physxArticulation:enabledSelfCollisions = 0 + int physxArticulation:solverPositionIterationCount = 32 + int physxArticulation:solverVelocityIterationCount = 1 + } + + over "robot_base" + { + over "collisions" + { + over "base" + { + over "mesh_1" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J1_link" + { + over "collisions" + { + over "j1" + { + over "mesh_3" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J2_link" + { + over "collisions" + { + over "j2" + { + over "mesh_5" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J3_link" + { + over "collisions" + { + over "j3" + { + over "mesh_7" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J4_link" + { + over "collisions" + { + over "j4" + { + over "mesh_9" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J5_link" + { + over "collisions" + { + over "j5" + { + over "mesh_11" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } + + over "J6_link" + { + over "collisions" + { + over "j6" + { + over "mesh_13" ( + ) + { + token physics:approximation = "convexHull" + } + } + } + } +} +