diff --git a/.gitattributes b/.gitattributes index 35c37af78a30b5e2b5bbdcb948e76925cb9dd0fd..c8f2814e82b09941bac369ab6eb584cc0356bf05 100644 --- a/.gitattributes +++ b/.gitattributes @@ -86,3 +86,18 @@ assets/pallet_stand/simready_usd/pallet_stand.usd filter=lfs diff=lfs merge=lfs assets/pegboard/simready_usd/pegboard.usd filter=lfs diff=lfs merge=lfs -text assets/platform_dolly/simready_usd/platform_dolly.usd filter=lfs diff=lfs merge=lfs -text assets/pliers/simready_usd/pliers.usd filter=lfs diff=lfs merge=lfs -text +assets/power_drill/simready_usd/power_drill.usd filter=lfs diff=lfs merge=lfs -text +assets/power_strip/simready_usd/power_strip.usd filter=lfs diff=lfs merge=lfs -text +assets/respirator/simready_usd/respirator.usd filter=lfs diff=lfs merge=lfs -text +assets/roller_conveyor/simready_usd/roller_conveyor.usd filter=lfs diff=lfs merge=lfs -text +assets/safety_barrier/simready_usd/safety_barrier.usd filter=lfs diff=lfs merge=lfs -text +assets/safety_cone/simready_usd/safety_cone.usd filter=lfs diff=lfs merge=lfs -text +assets/safety_goggles/simready_usd/safety_goggles.usd filter=lfs diff=lfs merge=lfs -text +assets/saftey_helmet/simready_usd/saftey_helmet.usd filter=lfs diff=lfs merge=lfs -text +assets/scraper/simready_usd/scraper.usd filter=lfs diff=lfs merge=lfs -text +assets/screwdriver/simready_usd/screwdriver.usd filter=lfs diff=lfs merge=lfs -text +assets/shovel/simready_usd/shovel.usd filter=lfs diff=lfs merge=lfs -text +assets/signal_tower/simready_usd/signal_tower.usd filter=lfs diff=lfs merge=lfs -text +assets/spanner/simready_usd/spanner.usd filter=lfs diff=lfs merge=lfs -text +assets/steel_drum/simready_usd/steel_drum.usd filter=lfs diff=lfs merge=lfs -text +assets/storage_rack/simready_usd/storage_rack.usd filter=lfs diff=lfs merge=lfs -text diff --git a/assets/power_drill/simready_usd/power_drill.usd b/assets/power_drill/simready_usd/power_drill.usd new file mode 100644 index 0000000000000000000000000000000000000000..99bf5a1d8b3937ff3da17e41618d1a88921eec89 --- /dev/null +++ b/assets/power_drill/simready_usd/power_drill.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bed8d86af49fd63163550e2a60c307ef97cf1b72d87e452d5bd13de4be19d2a +size 30753237 diff --git a/assets/power_drill/simready_usd/textures/Drill_battery_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_battery_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..b7922a07f61b9e05c2868ed6e468f90340ab57e9 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_battery_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33447010d5aa19ae28aebb03da411f1592676dfeaa1d74e5c943b36cc1f573a8 +size 1087247 diff --git a/assets/power_drill/simready_usd/textures/Drill_battery_Normal.png b/assets/power_drill/simready_usd/textures/Drill_battery_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..678dd8b9607508b3a2294414e28634896c4b7c65 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_battery_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:900beb000098dcc20f843400b034f20cc4630837d01802ae3d6902297d47565d +size 4837765 diff --git a/assets/power_drill/simready_usd/textures/Drill_battery_ORM.png b/assets/power_drill/simready_usd/textures/Drill_battery_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..0e8bedccd05cd4f2537549e832ab4240dbb40283 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_battery_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0dfb16187b30c2a5351dc43cf9b2005f0916e1cd160e5194c8d40a8398d54f4 +size 2285939 diff --git a/assets/power_drill/simready_usd/textures/Drill_bit_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_bit_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..c8edc48072f07ab37a9e8dfa451149e763042c08 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_bit_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4a92903361360435cc614f95d48b742b5fc1cb762865863bde35e660abc2f01 +size 5377628 diff --git a/assets/power_drill/simready_usd/textures/Drill_bit_Normal.png b/assets/power_drill/simready_usd/textures/Drill_bit_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..de6f7c0b022a8dd7b7cc753f161f739fa83d499b --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_bit_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1749ece866ca84b520b97037d6a7a98b3d6c4fbf3fb7512fb59c07600623f8e +size 5231731 diff --git a/assets/power_drill/simready_usd/textures/Drill_bit_ORM.png b/assets/power_drill/simready_usd/textures/Drill_bit_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..0dedc727949f9090ece7428738996f0b0d216688 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_bit_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e4276ada29b0c3832c33f46a13c674459eb10231b4bb1b7ae3572a0c3df177a +size 4622793 diff --git a/assets/power_drill/simready_usd/textures/Drill_body_001_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_body_001_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..448fa12043aae7af0cc2a97a5722539622b6fd9b --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_body_001_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f23b3846005bd8fd9a049d38ec9bcc8ebd0830c8e9e8ef100f6f1a4f1203a22 +size 856689 diff --git a/assets/power_drill/simready_usd/textures/Drill_body_001_Normal.png b/assets/power_drill/simready_usd/textures/Drill_body_001_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..84074dd699f33b3bb6238a85d075fa43d27aef52 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_body_001_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:182bae721595e664981ed01dfbf76a8b8252cfd37ca9d5a31ef52eb43e61c025 +size 5334452 diff --git a/assets/power_drill/simready_usd/textures/Drill_body_001_ORM.png b/assets/power_drill/simready_usd/textures/Drill_body_001_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..a62e6142f3b02a67acae06eb746f7d617bf724b2 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_body_001_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54a6bb882c61ecd52339cfd37a8821287dc6d67e341226d820c7c729f05b71ba +size 1538054 diff --git a/assets/power_drill/simready_usd/textures/Drill_body_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_body_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..2484f18e0566e1e7315be855fe79be3fd7466676 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_body_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2fa6c5562942b2546438991415f0a22ef134ae9c663341078595b7b5e48c365 +size 1755300 diff --git a/assets/power_drill/simready_usd/textures/Drill_body_Normal.png b/assets/power_drill/simready_usd/textures/Drill_body_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..425e3457e56aab93f53836d00ca18100ea5c6de6 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_body_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b4d11a6aa67ed34d308cf0366343bdce721d0bf62054db1e17646fc9627d518 +size 4654047 diff --git a/assets/power_drill/simready_usd/textures/Drill_body_ORM.png b/assets/power_drill/simready_usd/textures/Drill_body_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..ebab4bcfed7eb8a5704398625f13cf7cb533c9c1 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_body_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cc62deccdd5d6aae6b035afc33ed27857a646de3e2f1014f660437965b280f6 +size 2260305 diff --git a/assets/power_drill/simready_usd/textures/Drill_chuck_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_chuck_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..5150eb3507d3829bf86eec36b1d3c3725b523b8e --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_chuck_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad607781c035bd0dbf85249bbf8e4893d5206bd4fb3db97c701ec61fba83eb50 +size 2862607 diff --git a/assets/power_drill/simready_usd/textures/Drill_chuck_Normal.png b/assets/power_drill/simready_usd/textures/Drill_chuck_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..62ad78d979762be03b44132d5808e8a4cea12eb3 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_chuck_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:164bf7d80f132a1fc07faef0301bf4d70c6252801ea5f995d222badd913674d4 +size 5362646 diff --git a/assets/power_drill/simready_usd/textures/Drill_chuck_ORM.png b/assets/power_drill/simready_usd/textures/Drill_chuck_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..61b7f55a16818e8e4fa799fe2bd39fcb55219d28 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_chuck_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f0b225a18dc2a5069ded81f6c82b2181dcb241d20e41a5daabb8c397c3e1baf +size 3219887 diff --git a/assets/power_drill/simready_usd/textures/Drill_grip_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_grip_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..30e0bee2f4ccfec02a4290e283272e3171375eec --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_grip_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33a755dad86e2c5fc352c428b80710d172ba5429a0df3341dbcf6211f45652d1 +size 1255630 diff --git a/assets/power_drill/simready_usd/textures/Drill_grip_Normal.png b/assets/power_drill/simready_usd/textures/Drill_grip_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..82915e4d427898e71ddba8b5781166e560ebba4c --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_grip_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66b2a3a256ec5d43929ffa94845d878a5ab370f08ca4c291163febecffd8a57b +size 4986119 diff --git a/assets/power_drill/simready_usd/textures/Drill_grip_ORM.png b/assets/power_drill/simready_usd/textures/Drill_grip_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..1eb03ec0125f01f4540c80653e8616fb8382d83d --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_grip_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf460593050d437796b04651c6ed398b8fe9b8cd48dd32e0c47c34f20f4bdb95 +size 2410985 diff --git a/assets/power_drill/simready_usd/textures/Drill_trigger_BaseColor.png b/assets/power_drill/simready_usd/textures/Drill_trigger_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..388b25c0c9cc3a02fe7b28de7548f6e49b919cf5 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_trigger_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2544eb02a3b82ccc70cd5049df788931cb71cfd094c98623818d3271fded4ed1 +size 225546 diff --git a/assets/power_drill/simready_usd/textures/Drill_trigger_Normal.png b/assets/power_drill/simready_usd/textures/Drill_trigger_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..b55de46475cd52e7a082f4b58794643e2d629d65 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_trigger_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e94015773361a83d6c0b65ba055472b28d6111002f135761bf2e5604d4335f3 +size 3488092 diff --git a/assets/power_drill/simready_usd/textures/Drill_trigger_ORM.png b/assets/power_drill/simready_usd/textures/Drill_trigger_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..80c79613d57c1b9f5bf6adaf2332ed4112ab2279 --- /dev/null +++ b/assets/power_drill/simready_usd/textures/Drill_trigger_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54d09a98834f6896a580475b8a750ffad110cbd1f443becfe6769ebafae2bcb8 +size 438596 diff --git a/assets/power_strip/simready_usd/.simready/validation.json b/assets/power_strip/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c94852249c43047b64331045beb919e0a8de1e61 --- /dev/null +++ b/assets/power_strip/simready_usd/.simready/validation.json @@ -0,0 +1,174 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001', 'com.nvidia.simready.PMT.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001', 'com.nvidia.simready.VM.PBR.003']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd.png b/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..14349fea4b06fd212e685642e97659b15512b437 --- /dev/null +++ b/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fbf5dd3462706bd1bd43980148a470a3eb40a3fea4bd42beba707f891f5fbba +size 41992 diff --git a/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd_light.png b/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..89d6ed51e943fe31289a856f7ba236c1464699ee --- /dev/null +++ b/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d238a52663ba7637f6beaa97ce2e070d93ed15584ba403095b2e58437dbe8956 +size 14903 diff --git a/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd_transparent.png b/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..6f708a99828b796fd2063f31dcbb00840a1ead21 --- /dev/null +++ b/assets/power_strip/simready_usd/.thumbs/256x256/power_strip.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc546ce4604123f30320f5335815bddaffdc8f72d041aeedc3fdd7e14abf87b5 +size 7429 diff --git a/assets/power_strip/simready_usd/materials/OmniPBR.mdl b/assets/power_strip/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/power_strip/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/power_strip/simready_usd/materials/OmniPBRBase.mdl b/assets/power_strip/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/power_strip/simready_usd/materials/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/assets/power_strip/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/power_strip/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/power_strip/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/power_strip/simready_usd/post_validation.json b/assets/power_strip/simready_usd/post_validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c78ececf749aab88913d1766c1cffda96d9ca2ac --- /dev/null +++ b/assets/power_strip/simready_usd/post_validation.json @@ -0,0 +1,18 @@ +{ + "C:/srtest/def/pkg_repo/.packages/power_strip/1.0.0/Power_Strip.usd": { + "features_summary": { + "FET030_PACKAGING_CORE": { + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET032_PACKAGING_INTROSPECTION": { + "dependencies": "[{'FET030_PACKAGING_CORE': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.1.0" + } + }, + "profile_id": "Package", + "profile_version": "1.0.0" + } +} \ No newline at end of file diff --git a/assets/power_strip/simready_usd/power_strip.usd b/assets/power_strip/simready_usd/power_strip.usd new file mode 100644 index 0000000000000000000000000000000000000000..9611696b6a8dcde9382c2a0b73ea789b9e42feda --- /dev/null +++ b/assets/power_strip/simready_usd/power_strip.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6908dd285181b6aafe7a53a075693ab8d15994bb62cd0e3fbad564c7e875e428 +size 5319767 diff --git a/assets/power_strip/simready_usd/textures/T_Copper_Alloy_BaseColor.png b/assets/power_strip/simready_usd/textures/T_Copper_Alloy_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..37938bc0da0816b7402989554454ee8dcd725f34 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Copper_Alloy_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cc4ffdbbf17b9976b5f606cd15330e47c3a5f533b9fdd61613559966caedb44 +size 16906 diff --git a/assets/power_strip/simready_usd/textures/T_Copper_Alloy_Normal.png b/assets/power_strip/simready_usd/textures/T_Copper_Alloy_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..6e8bb2c51df65638c0316bbc1302896e444a235c --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Copper_Alloy_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e8e03aa8cd82062727d2973f725508b4a4b5047f5cd26a05a8cd40a917c44cb +size 1409121 diff --git a/assets/power_strip/simready_usd/textures/T_Copper_Alloy_OcclusionRoughnessMetallic.png b/assets/power_strip/simready_usd/textures/T_Copper_Alloy_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..37f57ac127a929ea579553565afa51c6e66173a5 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Copper_Alloy_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5034093174efdfbc6b930f5026c5a48285fab03e22167716375ab1f062c34d0 +size 425702 diff --git a/assets/power_strip/simready_usd/textures/T_Plastic_Pp_BaseColor.png b/assets/power_strip/simready_usd/textures/T_Plastic_Pp_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..e8c0534f1f5be200921086fd3f0467ca852deef6 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Plastic_Pp_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eed54266cb9dfd534d050bb31738390634810ee6f6f5d6106163742344549b89 +size 480849 diff --git a/assets/power_strip/simready_usd/textures/T_Plastic_Pp_Normal.png b/assets/power_strip/simready_usd/textures/T_Plastic_Pp_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..eeabdc9b4713d5aaf4a13a276a3a71172d9b40c1 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Plastic_Pp_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfc1a6aa8655c12132cd05b105ecf7a2c57a74228e11f0696750607ec133bece +size 2507904 diff --git a/assets/power_strip/simready_usd/textures/T_Plastic_Pp_OcclusionRoughnessMetallic.png b/assets/power_strip/simready_usd/textures/T_Plastic_Pp_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..745afb52130b19dfd6c548705a57be8edff0c6e7 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Plastic_Pp_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4170f55567b276b5b26f914be809e5ac46cfa4c39e10675321116bed26d0e88e +size 1186167 diff --git a/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_BaseColor.png b/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..00b9f04a8e3cde513bfac9b0c53b875b7f187453 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6635b6ede6d5d3540e43a73f6c5e348872430dac4a5f6e8d0e040c063782da8 +size 480016 diff --git a/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_Normal.png b/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..f5d164ba2b73519554897e779d007895cbca72fb --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c5d8e95fb811e6e6483aa1c15c3aea79da0091d19ffd14269e243f36e312665 +size 3718307 diff --git a/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_OcclusionRoughnessMetallic.png b/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..15d7ee69b8f86292ecf8f7eaf5c053dad79fb1bd --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Plastic_Pvc_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60f119cad42efc758a9e9ca7452d29550c6ec089d1d6e9b0c490071b822907c8 +size 1525382 diff --git a/assets/power_strip/simready_usd/textures/T_Steel_BaseColor.png b/assets/power_strip/simready_usd/textures/T_Steel_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..0e1df95c61a6e5bad9ba571d3e3f6c0e6217e443 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Steel_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d1153d8f09ea23df36be3f540a1f6e9a7b6d0e40c90c4fbd31085134c31363d +size 92673 diff --git a/assets/power_strip/simready_usd/textures/T_Steel_Normal.png b/assets/power_strip/simready_usd/textures/T_Steel_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..07289a9f618adb616013c27508e62c6107cff0fc --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Steel_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a1387001c454f782c8f883bd88947656fd479b87d6dcc3b2c9d195abaf3e9c9 +size 1509288 diff --git a/assets/power_strip/simready_usd/textures/T_Steel_OcclusionRoughnessMetallic.png b/assets/power_strip/simready_usd/textures/T_Steel_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfb4d62aa761b6541875c1e2e07f10ef290fda9 --- /dev/null +++ b/assets/power_strip/simready_usd/textures/T_Steel_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05dbc650cd56086f91f1d1f6726a5bc7862c1f26b7e2082374cd6ed41adee7ce +size 397502 diff --git a/assets/respirator/simready_usd/.simready/validation.json b/assets/respirator/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..534c988c50b042f2ce06910a73ba47dc2be15187 --- /dev/null +++ b/assets/respirator/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001', 'com.nvidia.simready.PMT.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001', 'com.nvidia.simready.VM.PBR.003']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd.png b/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..6d0b4a8e0712d0ee75b48a8a216e06bd5dd54ab1 --- /dev/null +++ b/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ea06d9f59f99b97841078068a8b9526cbab47689d5d704f32c6993bb42d2e56 +size 54957 diff --git a/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd_light.png b/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..2f5063da133fb25f1e65281c0355d500dfed1329 --- /dev/null +++ b/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:788f4bc0ce9d5c677611dc82188f9c64d6d4ad7f55ddc6c8cb056950045d9a57 +size 30442 diff --git a/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd_transparent.png b/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..a0ae9db678b9cc90ee9bdfc9b5e5abd85521eb10 --- /dev/null +++ b/assets/respirator/simready_usd/.thumbs/256x256/respirator.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45f59b715e61d39082ecaf0d088d72ee014e07f10f1c29548b01d6aba303b4d6 +size 32691 diff --git a/assets/respirator/simready_usd/materials/OmniPBR.mdl b/assets/respirator/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/respirator/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/respirator/simready_usd/materials/OmniPBRBase.mdl b/assets/respirator/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/respirator/simready_usd/materials/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/assets/respirator/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/respirator/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/respirator/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/respirator/simready_usd/post_validation.json b/assets/respirator/simready_usd/post_validation.json new file mode 100644 index 0000000000000000000000000000000000000000..3f223581f448fc1105ca3a6dbc4423746758b1ec --- /dev/null +++ b/assets/respirator/simready_usd/post_validation.json @@ -0,0 +1,18 @@ +{ + "C:/srtest/def/pkg_repo/.packages/respirator/1.0.0/Respirator.usd": { + "features_summary": { + "FET030_PACKAGING_CORE": { + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET032_PACKAGING_INTROSPECTION": { + "dependencies": "[{'FET030_PACKAGING_CORE': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.1.0" + } + }, + "profile_id": "Package", + "profile_version": "1.0.0" + } +} \ No newline at end of file diff --git a/assets/respirator/simready_usd/respirator.usd b/assets/respirator/simready_usd/respirator.usd new file mode 100644 index 0000000000000000000000000000000000000000..80f96079b2f8b10fca29d34f837dd4a26204d61e --- /dev/null +++ b/assets/respirator/simready_usd/respirator.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fd04bbe205232820fee78158321ed6cf74cc62286381ace9d40a0dd684103de +size 6207911 diff --git a/assets/respirator/simready_usd/textures/T_Fabric_PP_BaseColor.png b/assets/respirator/simready_usd/textures/T_Fabric_PP_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..b8fd2a55121d3e5c309fdc0a1ff58b8956db3077 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Fabric_PP_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:389c05e2a1ffb0502a444ef7fb4c8c0ef0ef0cb9518cda01380bec551b29da7b +size 2319431 diff --git a/assets/respirator/simready_usd/textures/T_Fabric_PP_Normal.png b/assets/respirator/simready_usd/textures/T_Fabric_PP_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..5aa5c94c5e4dfa434886232491c32cde028f27ca --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Fabric_PP_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e9c8c0545edf2715b7a7a046aa4b3d466f56bdcb3bda66da955cc713c6544ae +size 6121774 diff --git a/assets/respirator/simready_usd/textures/T_Fabric_PP_OcclusionRoughnessMetallic.png b/assets/respirator/simready_usd/textures/T_Fabric_PP_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..de532ac002a924bb151be56e4f6e104fb2db6610 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Fabric_PP_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d07b7b37796844c6e0abe00bc793fee9c16a0e649e1a3e5ee6c6c68eed005d72 +size 2217549 diff --git a/assets/respirator/simready_usd/textures/T_Fabric_Polyester_BaseColor.png b/assets/respirator/simready_usd/textures/T_Fabric_Polyester_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..f7e708d536c5b47dafbb96c594921ecae2939bd7 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Fabric_Polyester_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75a27ad8e9aab4996cde0bfc491b41938a476e49b832cac90a512abdaed234bd +size 89561 diff --git a/assets/respirator/simready_usd/textures/T_Fabric_Polyester_Normal.png b/assets/respirator/simready_usd/textures/T_Fabric_Polyester_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..f41cc8fd1c5ed3754e796769e34800c4f4eb274f --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Fabric_Polyester_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51e231cc9839212aacd8cceca9a10d94d44943c5cd0b78da3845b0727f1f70ff +size 2655141 diff --git a/assets/respirator/simready_usd/textures/T_Fabric_Polyester_OcclusionRoughnessMetallic.png b/assets/respirator/simready_usd/textures/T_Fabric_Polyester_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..38b04b521fab05fc9f0c3f9998c7941c9cc85d10 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Fabric_Polyester_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d5eac6fc76e3d4a14d109681405fb734af9e2f59719658185305bd49146d505 +size 85521 diff --git a/assets/respirator/simready_usd/textures/T_Plastic_PP_BaseColor.png b/assets/respirator/simready_usd/textures/T_Plastic_PP_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..2ab275b22d485f3476b6310ebbbb37413251f555 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Plastic_PP_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c16406f0974450c316b47ab6dbcccfc709ef5a8c9e237e03b67f9c7023c7f10 +size 115120 diff --git a/assets/respirator/simready_usd/textures/T_Plastic_PP_Normal.png b/assets/respirator/simready_usd/textures/T_Plastic_PP_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..c401201548be3a0a767ef3864f3bdcb3484847fc --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Plastic_PP_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28f5fc11f4a7bb208c6be4d6c8576c9217d6b95c4f187dedbd054e2d682c5e8b +size 2774744 diff --git a/assets/respirator/simready_usd/textures/T_Plastic_PP_OcclusionRoughnessMetallic.png b/assets/respirator/simready_usd/textures/T_Plastic_PP_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..06d68d7c7c9379b77510283ed1b2571b58777838 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Plastic_PP_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b71c3d368033e5394520fb03e9cfd08ad701e380de5fb691d847db0ac31445f0 +size 548175 diff --git a/assets/respirator/simready_usd/textures/T_Rubber_Silicone_BaseColor.png b/assets/respirator/simready_usd/textures/T_Rubber_Silicone_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..ae16260ae6be6f0e8bd82da99a74685d7c3f70e9 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Rubber_Silicone_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd72be08829127a1b784478110dd46e861fbd8aa53bc33faccd349d60c27b1d3 +size 1326423 diff --git a/assets/respirator/simready_usd/textures/T_Rubber_Silicone_Normal.png b/assets/respirator/simready_usd/textures/T_Rubber_Silicone_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..5bef2ba2ab08222fee04aabded9d552c537438a7 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Rubber_Silicone_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0116f5bd3c3806c23a74cebb97e0b3d008836cc29ce277afcfc17e7c2f8ce946 +size 4166299 diff --git a/assets/respirator/simready_usd/textures/T_Rubber_Silicone_OcclusionRoughnessMetallic.png b/assets/respirator/simready_usd/textures/T_Rubber_Silicone_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..696c00694772fabf7adb885aed576fa600d1c17e --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Rubber_Silicone_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fc104280fed515cc94caf016c4a45c0188ffe924fbbf5c245274dbfc5ecee17 +size 681188 diff --git a/assets/respirator/simready_usd/textures/T_Steel_Aluminum_BaseColor.png b/assets/respirator/simready_usd/textures/T_Steel_Aluminum_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..93896f3a0e27e6f794c9914c389068c775db0325 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Steel_Aluminum_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9bb623e9a4b3b8c2f45daa9815d58dda5a1466b5ee68e0016b7e837f02d6223 +size 16903 diff --git a/assets/respirator/simready_usd/textures/T_Steel_Aluminum_Normal.png b/assets/respirator/simready_usd/textures/T_Steel_Aluminum_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..c9d6804d92c761bf26cd6333dc7edbac0563c7c5 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Steel_Aluminum_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac0d4acea020b90e102525b16a9e1e4119199104ec27d61c380aed6ab0f2b57c +size 2743802 diff --git a/assets/respirator/simready_usd/textures/T_Steel_Aluminum_OcclusionRoughnessMetallic.png b/assets/respirator/simready_usd/textures/T_Steel_Aluminum_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed7c8eaba3b608e84ddcec53963e19c546bd379 --- /dev/null +++ b/assets/respirator/simready_usd/textures/T_Steel_Aluminum_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3f8c4a35f843d390fdebfa720d5b7eb2a807bd70c50a61cd01f127e06a54ea0 +size 778799 diff --git a/assets/roller_conveyor/simready_usd/.simready/validation.json b/assets/roller_conveyor/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..32c7579026033d33f74ebd891439ace860219898 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/.simready/validation.json @@ -0,0 +1,174 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd.png b/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..b809fd01568f9050421ff8e5d7bbb25034dddbcb --- /dev/null +++ b/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c4c9c4c92dacff88fe1b0e196a4477aafd98be3f1aff63d61df216e0eb0ea5d +size 80180 diff --git a/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd_light.png b/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..cfdbc8df32d2a732e8122ad38e4afb3bed4eb7e4 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8e5380b4f855ad52dbeab12a41c82c4703bcfd60527a9ddac0c05949bf31872 +size 63262 diff --git a/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd_transparent.png b/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..5eb40a845d824d76a907d22def2ed942da93c149 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/.thumbs/256x256/roller_conveyor.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c26e5e3d6fb3a6ec651f14479c2686db9f3de26fc177a5a9cd01dfb894499457 +size 58476 diff --git a/assets/roller_conveyor/simready_usd/materials/OmniPBR.mdl b/assets/roller_conveyor/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/roller_conveyor/simready_usd/materials/OmniPBRBase.mdl b/assets/roller_conveyor/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/materials/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/assets/roller_conveyor/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/roller_conveyor/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/roller_conveyor/simready_usd/roller_conveyor.usd b/assets/roller_conveyor/simready_usd/roller_conveyor.usd new file mode 100644 index 0000000000000000000000000000000000000000..2658569110e367ccdff0ab72a40f7975fedb0dfd --- /dev/null +++ b/assets/roller_conveyor/simready_usd/roller_conveyor.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2e5d12b07a3c6c0999e8988fa626bce29c59ab095afb3f59f35786fce0b7269 +size 186457471 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..0e02c51eb698eaab5ea06a1a0987d64bb90aef5a --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59075d0150b7db603b92e4c95b8c642e2b0c9c4d6fa9f8b81e36b98d4157f8c6 +size 16902 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..60eb51d50d1b48c3e643ec0a8b927dab09406b2e --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df9535f67fa4471986f13dcd149f57b749a36e053c96053e2fd3be6e9797be73 +size 2272942 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..121829078fe6916bed47a5062e6f89b120e171e2 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_29_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7af0abdf0972c1fc2ada6340f3a6bef41f05adb9869dab3707ee7eb186f1ca42 +size 412475 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..677001d0aec3881c15ff24e1d6e916c1bd6252ca --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10170027b72a8f63c428ef78c6e295501f0b550f403a86ed1b63766aedb6964d +size 331094 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..f7c0ffb3b198074d27bfd2d596116a60fb2f5802 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d53a277a1594d7d6a51b2226ad0777c3ca17aadeb605df9524703e626ea19d3 +size 2544321 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..bed88b91a2987d1c7e53de89bc23c47fbdae5e40 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_2_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:335906163ff4b142ccd60a9ec5c630cd2d5c1330b50001e94d9380f728011a1a +size 1601192 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..e435668748c299b8fee4e39831d2f98eb13f792c --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f00c20bf242c131ede2ea76f87ccf10bdc785be1b20b61a5389f12e4b5ad5365 +size 1262152 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..b522ef8f53529c74ce89cfbe121bf2178613fcac --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:929cee9f37b3ea735d731116c79303cc105580bc2752f1a50b203a446d181ab2 +size 2957254 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..b0bcb4b89173d98fba4e4315fb936f796ca5d73f --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_30_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53729293e0cd2a5c3ab82470f369f0fe825e03ca49d56f5aaf7cb046f9a34697 +size 1296786 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..f4b0115636880b98505c2412de9069d907239337 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91614e88ddd0f0672f4502ace89295e7e4269bab4c82f11a0a70f26748f6e581 +size 16903 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..a484f9557b90e57db582214b88e417a4e3b01552 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:024f9a9c1e1fee0481b9f5147c539bdef8876efa3ba9d2f4d4ca8e35dc4d361f +size 2859669 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..475704598a21f7935233b7ac06119d547a2c3d86 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_32_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d114224e5ac99049f769b25171466ecb4eccc2df1bc44be6bd66aeed3b6d109e +size 1217594 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..c12d1cbd295c9012c888eefc5b41df25e2f537c1 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0b85300bf7df1e718c19d8efb31daff9dc847aa8207debd4b7db1361fc6f8d0 +size 635717 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..916ab6ce729d979e735b89626bb985cb43fcdd34 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aaa7557f2c14fc197c0a297d7a9e28733ccdbf5dd7133ddcb18af6a5b35839d1 +size 3271752 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..50fdc4ef4335b571caa501a05ce5b53842117575 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_33_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:025abe940cfeb6d3dabc512ce807de349eac2e8f86438c7d54b36ea2b4b5f410 +size 626885 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..1447bd2d2db048bddc6876e874087c69442c6d65 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fe8a9760e6253355f49bf1b34c9ce083ecb4d7a35d49023b58ff98171ad9d10 +size 917969 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..e6268d56fb91d176134ed3acee99414075ebd041 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:871a08b882e600f0e8d3edac52a67620155b92abcb5910a4424cad14144aacfd +size 2440204 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..dbbfbada6d21e54ab6187e8e70df0db6ce815fbd --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_3_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e51731a93a3d6557b393e83acfe44f81ca69e7766e6d593f311b765a32846e52 +size 829024 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..4ed1ae177168f7a49069bf90f62292c2b37ce01d --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c95019666b4d39f8d2211112def9823a71b1237c96d868ad95edf28063483e3 +size 2517701 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..a819567fa8dd318c5efb3b16e57f9e0f0dcb5202 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a93078b06a4187c1fe60584e80c564bb5467da3ab26e5910987d1745bd6cdfc +size 2981489 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..c2208c0700bcaf31a0b59befd3e2687b914999b7 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_4_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60d72b17cda72bab38f1a97f4ef423a8063f4b9780a85c8a0760a15f0c09fdf3 +size 4374929 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..0454967a7aa4927d415c5a7c691f5bef5f0e3f63 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d78528e9f1ebd2726bf0be107539b31b56b5a9e821320fcc78d66e24955f8e8e +size 1701635 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..001e080ac5a61bb023f0f328f542bf6d83a38c4a --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddd264a81918ea3edf4928f4a0b537fa885182f9156dbd39818d075ab487cb37 +size 5221161 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..68c8792a3c0db7b3407b2f3f10ce588e63eacacd --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_5_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dea50b12dc7f4a67f7f6635cf85130ee5851ba5428374751d5a8b7715cb14fdf +size 1960369 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_BaseColor.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..b3f8c5d523214a8bc6b9de8e8260eb169303b3a2 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c552e1c622ceddb526d4418e2860d48911409b6bff52c69dee25e0905cf0467 +size 142492 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_Normal.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..a9955b9201bc99481d213acb4e0c8717aa95f456 --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51b516e651b862e6fae3fcd8234a212ffc4840d85a9df9d748b9ce194682f41e +size 2322597 diff --git a/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_ORM.png b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_ORM.png new file mode 100644 index 0000000000000000000000000000000000000000..5445e0b98e6746c3597a74d4a3c5a5012663e67b --- /dev/null +++ b/assets/roller_conveyor/simready_usd/textures/M_Roller_Conveyor_6_ORM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1d092b2ae94a87ec048d8de9470896cdda9bf09c04358f176a3424770892cf7 +size 229262 diff --git a/assets/safety_barrier/simready_usd/.simready/validation.json b/assets/safety_barrier/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..14b4b14ef1fb917401af651446e114e40959084d --- /dev/null +++ b/assets/safety_barrier/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd.png b/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..30c4f529d1b088fd63100f8809a80f22e0592028 --- /dev/null +++ b/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f27e7f857f01278863beb782a80748c09aef1a8bd2c661351a5ff2193213b6ea +size 60519 diff --git a/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd_light.png b/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..2f1795e6e55b5607f133450b493e6a6b445cc72a --- /dev/null +++ b/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2227a7fdde01e8a95e5c986888e1d2c8530e852d8c0f46278e533e2093b48ddd +size 56148 diff --git a/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd_transparent.png b/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..57dddc3e98a65ca9559459094b21e58f75442cae --- /dev/null +++ b/assets/safety_barrier/simready_usd/.thumbs/256x256/safety_barrier.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6520cc89fec492589534aa3a9cbb6f7ba82b3bd8afa38647705b309eb6dc619 +size 47494 diff --git a/assets/safety_barrier/simready_usd/materials/OmniPBR.mdl b/assets/safety_barrier/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/safety_barrier/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/safety_barrier/simready_usd/materials/OmniPBRBase.mdl b/assets/safety_barrier/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/safety_barrier/simready_usd/materials/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/assets/safety_barrier/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/safety_barrier/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/safety_barrier/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/safety_barrier/simready_usd/post_validation.json b/assets/safety_barrier/simready_usd/post_validation.json new file mode 100644 index 0000000000000000000000000000000000000000..c5b97c173764621648966cc22ecea04f3a5e8b78 --- /dev/null +++ b/assets/safety_barrier/simready_usd/post_validation.json @@ -0,0 +1,18 @@ +{ + "C:/srtest/2nd/pkg_repo/.packages/safety_barrier/1.0.0/Safety_Barrier.usd": { + "features_summary": { + "FET030_PACKAGING_CORE": { + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET032_PACKAGING_INTROSPECTION": { + "dependencies": "[{'FET030_PACKAGING_CORE': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.1.0" + } + }, + "profile_id": "Package", + "profile_version": "1.0.0" + } +} \ No newline at end of file diff --git a/assets/safety_barrier/simready_usd/safety_barrier.usd b/assets/safety_barrier/simready_usd/safety_barrier.usd new file mode 100644 index 0000000000000000000000000000000000000000..07914484e2ee56713db7cf3354cdece6d236c527 --- /dev/null +++ b/assets/safety_barrier/simready_usd/safety_barrier.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29163bcf9fa07ac1d4ed3ce7e2871acbcf2ba98030c5431fe4cb1bda0582a948 +size 355335 diff --git a/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_BaseColor.png b/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..eafd32fa58e63d5f6b9b418377c74777b617a734 --- /dev/null +++ b/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc4f38e18df2ecec3c4da0ef57f997d4cb6f802076704b49b5ced22c7ffc0dca +size 2239281 diff --git a/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_Normal.png b/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..ef0f16e7e8dea99777b0c797b2f85bb10e2377a7 --- /dev/null +++ b/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25492a7be2a997aaeabc1f64600b0eb9ad41221c12577784c018e465c655068c +size 2721625 diff --git a/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_OcclusionRoughnessMetallic.png b/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..1d21ffe90803bc3ed97703dfc828936d9d8f9c54 --- /dev/null +++ b/assets/safety_barrier/simready_usd/textures/T_Steel_Painted_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33ccf10939247e902709c82ecdcb39b5e223e7745ea03d1e275d340ce8abda74 +size 3459965 diff --git a/assets/safety_cone/simready_usd/.simready/validation.json b/assets/safety_cone/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..14b4b14ef1fb917401af651446e114e40959084d --- /dev/null +++ b/assets/safety_cone/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd.png b/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..fe7678955762cf283b0495eeff016fbfe452a850 --- /dev/null +++ b/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11dc5ce11e1dfb4aa637038cb87f02627de48c4fb1934c96434286203e3c6ef6 +size 49008 diff --git a/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd_light.png b/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..5f3f5694282c5820447d80bac68ff9b7d0dfeb00 --- /dev/null +++ b/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13a5b5bb3665476f0ad2d5072b4737bde61f36053899f3da307cf8eadcea1355 +size 30832 diff --git a/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd_transparent.png b/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..cdd368c9a9ef75958f3a9b08eebdf3143a329346 --- /dev/null +++ b/assets/safety_cone/simready_usd/.thumbs/256x256/safety_cone.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2742a5c0cb1eda985fc99b426586e773fbbd822e0e7b1d1701f28d17928d1427 +size 26578 diff --git a/assets/safety_cone/simready_usd/materials/OmniPBR.mdl b/assets/safety_cone/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/safety_cone/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/safety_cone/simready_usd/materials/OmniPBRBase.mdl b/assets/safety_cone/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/safety_cone/simready_usd/materials/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/assets/safety_cone/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/safety_cone/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/safety_cone/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/safety_cone/simready_usd/safety_cone.usd b/assets/safety_cone/simready_usd/safety_cone.usd new file mode 100644 index 0000000000000000000000000000000000000000..f71cb846fab1068eb2ca99ecae2fc1225d5188c4 --- /dev/null +++ b/assets/safety_cone/simready_usd/safety_cone.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:250945310fa195b798e0fcc26c24fcf5e044940d8f27be876d1c64c22a617d95 +size 629509 diff --git a/assets/safety_cone/simready_usd/textures/M_safety_cone_BaseColor.png b/assets/safety_cone/simready_usd/textures/M_safety_cone_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..210e16df6f1aa60d6f31961d243cc80e8ddacd5d --- /dev/null +++ b/assets/safety_cone/simready_usd/textures/M_safety_cone_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c625ee7642e7318bcd44cfc30c1932b95b0dbe32cbc0be55188fe71f96089d2 +size 588468 diff --git a/assets/safety_cone/simready_usd/textures/M_safety_cone_Normal.png b/assets/safety_cone/simready_usd/textures/M_safety_cone_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..554c55ad42d21d7276a5e9c451b09d89e4216bee --- /dev/null +++ b/assets/safety_cone/simready_usd/textures/M_safety_cone_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4c9584c41e2bcb3c97f393cbd495b7fb9ee43875a0f67b823986a04829f28d3 +size 400030 diff --git a/assets/safety_cone/simready_usd/textures/M_safety_cone_OcclusionRoughnessMetallic.png b/assets/safety_cone/simready_usd/textures/M_safety_cone_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..6936fddc0b433ca40ab200223802ab2a4062bb03 --- /dev/null +++ b/assets/safety_cone/simready_usd/textures/M_safety_cone_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2dc1223ac70e49665e466f00466c8a5a788d38beeec2e7ff2d6ccdf26e433af3 +size 1874093 diff --git a/assets/safety_goggles/simready_usd/.simready/validation.json b/assets/safety_goggles/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..534c988c50b042f2ce06910a73ba47dc2be15187 --- /dev/null +++ b/assets/safety_goggles/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001', 'com.nvidia.simready.PMT.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001', 'com.nvidia.simready.VM.PBR.003']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd.png b/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..87ccaa3ab1b69f9bf53239b26e4221ba611c792e --- /dev/null +++ b/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:944beb700d2079b41f028f6830aa5a2e8cff8a9f2530d00bb3b07d607223100f +size 50363 diff --git a/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd_light.png b/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..1cdc3d68cb1ecc7273cb007abf4538c0c29341ca --- /dev/null +++ b/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7e179079e79ccdd752755b666b8c99decbacd727e41b26284d7788d3f081fba +size 46296 diff --git a/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd_transparent.png b/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..52b9c54b2cce04753ce1d493185b6d8b63fa56e2 --- /dev/null +++ b/assets/safety_goggles/simready_usd/.thumbs/256x256/safety_goggles.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b45da58f486f7a59e5bbded8931c11efc111156d024611dd127ba66dba3fea0 +size 34037 diff --git a/assets/safety_goggles/simready_usd/materials/OmniGlass.mdl b/assets/safety_goggles/simready_usd/materials/OmniGlass.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5a658cef20edae3e2d269a31ef1b0f50dca2c4f6 --- /dev/null +++ b/assets/safety_goggles/simready_usd/materials/OmniGlass.mdl @@ -0,0 +1,238 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; +import ::anno::*; +import ::base::*; +import ::tex::*; + +using OmniGlass_Opacity import OmniGlass_Opacity; +export annotation distill_off(); + + +export material OmniGlass +( + color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material + [[ + anno::hidden(), + anno::unused() + ]], + uniform bool use_glass_color_texture = false + [[ + anno::hidden(), + anno::unused() + ]], + uniform color glass_color = color(1.f, 1.f, 1.f) + [[ + anno::display_name("Glass Color"), + anno::description("Sets the color of the glass"), + anno::hard_range(color(0.0), color(1.0)), + anno::in_group("Color") + ]], + uniform texture_2d glass_color_texture = texture_2d() + [[ + anno::display_name("Glass Color Texture"), + anno::description("Specifies the texture to be used for the glass color of the material"), + anno::in_group("Color") + ]], + float frosting_roughness = 0.f + [[ + anno::display_name("Glass Roughness"), + anno::description("Sets the roughness of the glass material "), + anno::hard_range(0.0, 1.0), + anno::in_group("Roughness") + ]], + uniform float glass_ior = 1.491f + [[ + anno::display_name("Glass IOR"), + anno::description("Sets IOR of the glass material "), + anno::soft_range(1.0f, 4.0f), + anno::in_group("Refraction") + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin Walled"), + anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"), + anno::in_group("Refraction") + ]], + uniform float depth = 0.001f + [[ + anno::description("Controls how much light is absorbed through the surface"), + anno::display_name("Volume Absorption Scale"), + anno::in_group("Color"), + anno::soft_range(0.f, 1.f), + anno::hard_range(0.f, 1000.f) + ]], + float roughness_texture_influence = 1.f + [[ + anno::display_name("Roughness Texture Influence"), + anno::in_group("Roughness"), + anno::hard_range(0.0f, 1.0f) + ]], + uniform texture_2d roughness_texture = texture_2d() + [[ + anno::description("The roughness texture"), + anno::display_name("Roughness Texture"), + anno::in_group("Roughness"), + anno::usage("roughness") + ]], + uniform texture_2d reflection_color_texture = texture_2d() + [[ + anno::description("The reflection color texture"), + anno::display_name("Reflection Color Texture"), + anno::in_group("Reflection") + ]], + uniform color reflection_color = color(1.f, 1.f, 1.f) + [[ + anno::display_name("Reflection Color"), + anno::in_group("Reflection") + ]], + uniform texture_2d normal_map_texture = texture_2d() + [[ + anno::description("The normal map texture"), + anno::display_name("Normal Map Texture"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float normal_map_strength = 1.0 + [[ + anno::description("Determines the degree of bumpiness"), + anno::display_name("Normal Map Strength"), + anno::in_group("Normal"), + anno::usage(""), + anno::soft_range(0.f, 1.f) + ]], + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.f, 1.f), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("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") + ]], + + // 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 float cutout_opacity = 1.0f + [[ + anno::hard_range(0.0, 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") + ]], + uniform texture_2d cutout_opacity_texture = texture_2d() + [[ + anno::description("The opacity map"), + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha + [[ + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::display_name("Opacity Mono Source"), + anno::in_group("Opacity"), + anno::usage("") + ]], + uniform float opacity_threshold = 0.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If negative, disable cutout_opacity; 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") + ]], + + // UV 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 set to 'true' uses world space for projection, when 'false' object space is used"), + anno::in_group("UV") + ]], + + // UV Space Selector + uniform int uv_space_index = 0 + [[ + anno::display_name("UV Space Index"), + anno::description("Choose the UV Space Index to be used"), + anno::in_group("UV"), + anno::hard_range(0, 3) + ]], + uniform float2 texture_translate = float2(0.0f) + [[ + anno::display_name("Texture Translate"), + anno::description("Controls the position of the texture."), + anno::in_group("UV") + ]], + uniform float texture_rotate = 0.f + [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of the texture in degrees."), + anno::in_group("UV") + ]], + uniform float2 texture_scale = float2(1.0f) + [[ + anno::display_name("Texture Tiling"), + anno::description("Controls repetition of the texture."), + anno::in_group("UV") + ]] +) +[[ + anno::author("NVIDIA CORPORATION"), + anno::display_name("Omni Glass"), + anno::version( 1, 0, 0), + anno::in_group("Base"), + anno::description("Omni Glass Material V2"), + anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")), + distill_off() +]] += OmniGlass_Opacity( + glass_color: glass_color, + glass_color_texture: glass_color_texture, + frosting_roughness: frosting_roughness, + glass_ior: glass_ior, + thin_walled: thin_walled, + depth: depth, + roughness_texture_influence: roughness_texture_influence, + roughness_texture: roughness_texture, + reflection_color_texture: reflection_color_texture, + reflection_color: reflection_color, + normal_map_texture: normal_map_texture, + normal_map_strength: normal_map_strength, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + enable_opacity: enable_opacity, + cutout_opacity: cutout_opacity, + cutout_opacity_texture: cutout_opacity_texture, + cutout_opacity_mono_source: cutout_opacity_mono_source, + opacity_threshold: opacity_threshold, + 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 +); \ No newline at end of file diff --git a/assets/safety_goggles/simready_usd/materials/OmniGlass_Opacity.mdl b/assets/safety_goggles/simready_usd/materials/OmniGlass_Opacity.mdl new file mode 100644 index 0000000000000000000000000000000000000000..567be528500dc5302d1e919790c2e06b15b3dc75 --- /dev/null +++ b/assets/safety_goggles/simready_usd/materials/OmniGlass_Opacity.mdl @@ -0,0 +1,464 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + + +mdl 1.4; + +import ::tex::*; +import ::base::*; +import ::math::*; +import ::anno::*; +import ::df::*; +import ::state::*; +import OmniPBRBase::*; + +const string COPYRIGHT = +" Copyright 1986, 2020 NVIDIA Corporation. All rights reserved.\n" +" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n" +" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" +" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n" +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" +" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n" +" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n" +" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n" +" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n" +" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n"; + +export annotation distill_off(); + + +float get_float( + uniform texture_2d t, + float f, + base::texture_coordinate_info uvw, + uniform base::mono_mode mono_source = base::mono_maximum +) +{ + return tex::texture_isvalid(t) ? + base::file_texture( + t, + color(0.f, 0.f, 0.f), + color(1.f, 1.f, 1.f), + mono_source, + uvw, + float2(0.f, 1.f), + float2(0.f, 1.f), + tex::wrap_repeat, + tex::wrap_repeat, + false + ).mono : + f; +} + +color get_color( + uniform texture_2d t, + color c, + base::texture_coordinate_info uvw +) +{ + return tex::texture_isvalid(t) ? + base::file_texture( + t, + color(0.f, 0.f, 0.f), + color(1.f, 1.f, 1.f), + base::mono_alpha, + uvw, + float2(0.f, 1.f), + float2(0.f, 1.f), + tex::wrap_repeat, + tex::wrap_repeat, + false + ).tint : + c; +} + +float apply_roughness_influence( + uniform texture_2d roughness_texture, + float constant_roughness, + float roughness_influence, + base::texture_coordinate_info uvw +) +{ + return math::lerp( + constant_roughness, + get_float(roughness_texture, constant_roughness, uvw), + roughness_influence + ); +} + +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 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 material OmniGlass_Opacity +( + color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material + [[ + anno::hidden(), + anno::unused() + ]], + uniform bool use_glass_color_texture = false + [[ + anno::hidden(), + anno::unused() + ]], + uniform color glass_color = color(1.f, 1.f, 1.f) + [[ + anno::display_name("Glass Color"), + anno::description("Sets the color of the glass"), + anno::hard_range(color(0.0), color(1.0)), + anno::in_group("Color") + ]], + uniform texture_2d glass_color_texture = texture_2d() + [[ + anno::display_name("Glass Color Texture"), + anno::description("Specifies the texture to be used for the glass color of the material"), + anno::in_group("Color") + ]], + float frosting_roughness = 0.f + [[ + anno::display_name("Glass Roughness"), + anno::description("Sets the roughness of the glass material "), + anno::hard_range(0.0, 1.0), + anno::in_group("Roughness") + ]], + uniform float glass_ior = 1.491f + [[ + anno::display_name("Glass IOR"), + anno::description("Sets IOR of the glass material "), + anno::soft_range(1.0f, 4.0f), + anno::in_group("Refraction") + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin Walled"), + anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"), + anno::in_group("Refraction") + ]], + uniform float depth = 0.001f + [[ + anno::description("Controls how much light is absorbed through the surface"), + anno::display_name("Volume Absorption Scale"), + anno::in_group("Color"), + anno::soft_range(0.f, 1.f), + anno::hard_range(0.f, 1000.f) + ]], + float roughness_texture_influence = 1.f + [[ + anno::display_name("Roughness Texture Influence"), + anno::in_group("Roughness"), + anno::hard_range(0.0f, 1.0f) + ]], + uniform texture_2d roughness_texture = texture_2d() + [[ + anno::description("The roughness texture"), + anno::display_name("Roughness Texture"), + anno::in_group("Roughness"), + anno::usage("") + ]], + uniform texture_2d reflection_color_texture = texture_2d() + [[ + anno::description("The reflection color texture"), + anno::display_name("Reflection Color Texture"), + anno::in_group("Reflection") + ]], + uniform color reflection_color = color(1.f, 1.f, 1.f) + [[ + anno::display_name("Reflection Color"), + anno::in_group("Reflection") + ]], + uniform texture_2d normal_map_texture = texture_2d() + [[ + anno::description("The normal map texture"), + anno::display_name("Normal Map Texture"), + anno::in_group("Normal"), + anno::usage("") + ]], + uniform float normal_map_strength = 1.0 + [[ + anno::description("Determines the degree of bumpiness"), + anno::display_name("Normal Map Strength"), + anno::in_group("Normal"), + anno::usage(""), + anno::soft_range(0.f, 1.f) + ]], + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.f, 1.f), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("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") + ]], + + // Cutout Opacity + uniform bool enable_opacity = true + [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform float cutout_opacity = 1.0f + [[ + anno::hard_range(0.0, 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") + ]], + uniform texture_2d cutout_opacity_texture = texture_2d() + [[ + anno::description("The opacity map"), + anno::display_name("Opacity Map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha + [[ + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::display_name("Opacity Mono Source"), + anno::in_group("Opacity"), + anno::usage("") + ]], + uniform float opacity_threshold = 0.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If negative, disable cutout_opacity; 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") + ]], + + // UV 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 set to 'true' uses world space for projection, when 'false' object space is used"), + anno::in_group("UV") + ]], + + // UV Space Selector + uniform int uv_space_index = 0 + [[ + anno::display_name("UV Space Index"), + anno::description("Choose the UV Space Index to be used"), + anno::in_group("UV"), + anno::hard_range(0, 3) + ]], + uniform float2 texture_translate = float2(0.0f) + [[ + anno::display_name("Texture Translate"), + anno::description("Controls the position of the texture."), + anno::in_group("UV") + ]], + uniform float texture_rotate = 0.f + [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of the texture in degrees."), + anno::in_group("UV") + ]], + uniform float2 texture_scale = float2(1.0f) + [[ + anno::display_name("Texture Scale"), + anno::description("Larger numbers increase the size."), + anno::in_group("UV") + ]] +) +[[ + anno::copyright_notice(COPYRIGHT), + anno::author("NVIDIA CORPORATION"), + anno::display_name("Omni Glass Opacity"), + anno::version( 1, 0, 0), + anno::description("Omni Glass Opacity Material"), + anno::in_group("Base"), + anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")), + distill_off() +]] += let { + // Material Properties + bool local_thin_walled = (tex::texture_isvalid(cutout_opacity_texture) || cutout_opacity != 1.f) ? true : thin_walled; + color local_glass_ior = glass_ior; + + + // UVW Properties + // Generating the texture coordinates for the texture lookups + 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 + ); + + + // Opacity Properties + float opacity_value = get_float(cutout_opacity_texture, cutout_opacity, transformed_uvw, cutout_opacity_mono_source); + + // The opacity_threshold is interpreted as follows: + // 1. opacity_threshold > 0: binary opacity masking mode + // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0 + // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched, + // allowing the renderer to use fractional cutout_opacity values, if it supports this feature + // + // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets + // cutout_opacity values of 1.0 as opaque and anything below as fully transparent + float local_cutout_opacity = enable_opacity ? + ((opacity_threshold == 0.0) ? + opacity_value : + ((opacity_value >= opacity_threshold) ? 1.0 : 0) + ) : + 1.0; + + + // Surface Properties + color local_reflection_color = get_color(reflection_color_texture, reflection_color, transformed_uvw); + color local_transmission_color = get_color(glass_color_texture, glass_color, transformed_uvw); + + OmniPBRBase::NormalData defaultData(state::normal(), float2(0.f)); + OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normal_map_texture) ? + OmniPBRBase::tangent_space_normal_roughness_texture( + normal_map_texture, + normal_map_strength, + flip_tangent_u, + flip_tangent_v, + transformed_uvw, + float2(0.f, 1.f), + float2(0.f, 1.f), + tex::wrap_repeat, + tex::wrap_repeat, + false, + 1.f, + 0.f, + 0.f, + int2(0), + tex::wrap_repeat, + 30.f + ) : + defaultData; + + float local_roughness = apply_roughness_influence( + roughness_texture, + frosting_roughness, + roughness_texture_influence, + transformed_uvw + ); + float2 local_roughness_squared( + (local_roughness * local_roughness + + geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x), + (local_roughness * local_roughness + + geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y) + ); + + float3 the_normal = normal_data.normal; + + bsdf ggx_1 = ::df::microfacet_ggx_smith_bsdf( + roughness_u: local_roughness_squared.x, + roughness_v: local_roughness_squared.y, + tint: local_reflection_color, + tangent_u: ::state::texture_tangent_u(0), + mode: ::df::scatter_reflect + ); + + bsdf ggx_2 = ::df::microfacet_ggx_smith_bsdf( + roughness_u: local_roughness_squared.x, + roughness_v: local_roughness_squared.y, + tint: local_transmission_color, + tangent_u: ::state::texture_tangent_u(0), + mode: ::df::scatter_transmit + ); + + material_surface local_surface( + ::df::fresnel_layer( + ior: glass_ior, + weight: 1.f, + layer: ggx_1, + base: ggx_2, + normal: the_normal + ), + material_emission() + ); + + + // Volume Properties + color local_volume_absorption = depth; + color local_volume_scattering = color(0.f, 0.f, 0.f); + + material_volume local_volume(vdf(), local_volume_absorption, local_volume_scattering); + + + // Geometry Properties + material_geometry local_geometry(float3(0.f), local_cutout_opacity, the_normal); + +} in material( + thin_walled: local_thin_walled, + surface: local_surface, + ior: local_glass_ior, + volume: local_volume, + geometry: local_geometry +); diff --git a/assets/safety_goggles/simready_usd/materials/OmniPBR.mdl b/assets/safety_goggles/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/safety_goggles/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/safety_goggles/simready_usd/materials/OmniPBRBase.mdl b/assets/safety_goggles/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/safety_goggles/simready_usd/materials/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/assets/safety_goggles/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/safety_goggles/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/safety_goggles/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/safety_goggles/simready_usd/post_validation.json b/assets/safety_goggles/simready_usd/post_validation.json new file mode 100644 index 0000000000000000000000000000000000000000..311d317dcb21c80480f9a0e89158c06a3f54d301 --- /dev/null +++ b/assets/safety_goggles/simready_usd/post_validation.json @@ -0,0 +1,18 @@ +{ + "C:/srtest/def/pkg_repo/.packages/safety_goggles/1.0.0/Safety_Goggles.usd": { + "features_summary": { + "FET030_PACKAGING_CORE": { + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET032_PACKAGING_INTROSPECTION": { + "dependencies": "[{'FET030_PACKAGING_CORE': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.1.0" + } + }, + "profile_id": "Package", + "profile_version": "1.0.0" + } +} \ No newline at end of file diff --git a/assets/safety_goggles/simready_usd/safety_goggles.usd b/assets/safety_goggles/simready_usd/safety_goggles.usd new file mode 100644 index 0000000000000000000000000000000000000000..1b614108e4fc8e331a7a96e4ac4c6270ab63ec25 --- /dev/null +++ b/assets/safety_goggles/simready_usd/safety_goggles.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd4c74cf6236b099a4dfcd1f81ecca13f29d2c2bf1191fe4af6d48cffc0de449 +size 1787651 diff --git a/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_BaseColor.png b/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..d11358d3ab152b98d0a9e06e86e536bf6bb591ca --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82e98e78fdcc197fa085b6349e4cc2a162b97349bc1bc4cb44c2c95954817b5e +size 349366 diff --git a/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_Normal.png b/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..f2a788afd55ebdfb8e12f46452b22dd75f012a2f --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08738e0e127dd3da759de48855846bf4723b64acd647a951ecb9d1d56189ea4d +size 4003253 diff --git a/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_OcclusionRoughnessMetallic.png b/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..8ee189762eb1e39e2db390a3d2b834ec40e8c7a9 --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Fabric_Polyester_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a7ad38bd7c3cc89e1e184d9c83e4e44a47cdd9e472dceaee070a6c1dfa8bfc6 +size 178116 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_BaseColor.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..5f413180b55926c56e0d63f96ffd7fe4710c4c84 --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c78f111785db27f9e7f8a47bcb0bd399f28ab68a979b5931ffa78f8ec515fc1 +size 265390 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_Normal.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..3ac983227302293229641fc1ba15410226ca2d04 --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecc098ffdd44433639281360d6862944491ebdd6e897bbb1fe70d777f2259360 +size 3097825 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_OcclusionRoughnessMetallic.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..a461791626eadb39933e81fdaed3228702fb8907 --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Abs_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f811bc1c5bb3472e72e13f17c688aacb79667092df00a0f07d69e978f5bc330 +size 739621 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_BaseColor.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..f8b0478d4e281caab77f683eb2e2ee243403575b --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed648abbf9de4e58f5ee670e71691cf8e59f9514e68faafb5424921808a3d08b +size 124677 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_Normal.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..4991795923b96859a5c66c76988dfa0d4d9bc36c --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bce3543296635aacff85130b2a1ff9e15458a04821fa6040aae787294a5e2ed +size 2075519 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_Roughness.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..cf3a1137d42b1095589cd6146ca9158b8bd90bba --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pc_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fa28d2f07f29d81f7edf25da3a19764b881dabd2ed691f9120f306cb601d2d6 +size 285554 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_BaseColor.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..788ecbf8fb079d13bcc5d43331446a2e56958206 --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7595a4362efa172d08506bc9bb04331cd92023e3e5158dc8acf2d1119135e28 +size 16905 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_Normal.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..36c6264d51c364f5a1ac6f05a24728daa2d9612f --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:001cb2a11521c66934475805060048fb42b3ca7ab0e80e8ee57e623b3802280e +size 2288237 diff --git a/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_OcclusionRoughnessMetallic.png b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..fe2b97fbfeefcb58446573e00c290641196dee47 --- /dev/null +++ b/assets/safety_goggles/simready_usd/textures/T_Plastic_Pp_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:834af0501ced6d17bc73c935f2e10d982df9b8e9b95513ccb4c06f473486a140 +size 284243 diff --git a/assets/saftey_helmet/simready_usd/.simready/validation.json b/assets/saftey_helmet/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..14b4b14ef1fb917401af651446e114e40959084d --- /dev/null +++ b/assets/saftey_helmet/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd.png b/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..b231cafb8c74cafc4a160b332ecc2c0b36f67066 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f458f360fe5d55c7335d27c4a8191fa95aabe35dcc208734f7117ee549257c4 +size 58605 diff --git a/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd_light.png b/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..af4b13d731dd041d6935f370e5b65cbdfd875e7a --- /dev/null +++ b/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c2620e61b22dd7317588c3e5d6c6ce97cb41436dca47887a489f5ee0e6d9f99 +size 49322 diff --git a/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd_transparent.png b/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..1ea48a235a8ca25083ca01cae1131eac682f398f --- /dev/null +++ b/assets/saftey_helmet/simready_usd/.thumbs/256x256/saftey_helmet.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ced500bfa06f5bcf1c40aa0ab9b9ada471336ff25e56026e18d3b4cf060bb6d +size 49041 diff --git a/assets/saftey_helmet/simready_usd/materials/OmniPBR.mdl b/assets/saftey_helmet/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/saftey_helmet/simready_usd/materials/OmniPBRBase.mdl b/assets/saftey_helmet/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/materials/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/assets/saftey_helmet/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/saftey_helmet/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/saftey_helmet/simready_usd/saftey_helmet.usd b/assets/saftey_helmet/simready_usd/saftey_helmet.usd new file mode 100644 index 0000000000000000000000000000000000000000..c20e5422543be15fd1c1f0c7dddb2e7a552a85f3 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/saftey_helmet.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e2e78597bf7a995bf578acaef8a5333f2f00dda210de282a7f16514b6f18ceb +size 3242189 diff --git a/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_BaseColor.png b/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..4088838247afcef677958e68b77adb72e7493a84 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c68d86b8f45ba83ab3154d17d7e3accb674ac72e7bfb7f39e4f3bd969b1cc28 +size 467338 diff --git a/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_Normal.png b/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..c9c86a59a14433c4c42c5886f2e0344729f9bae0 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b0148e83aa7bf3471a89d89e6a7da70a03ac3be67cd8789508e452e4ce4c55e +size 2916981 diff --git a/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_OcclusionRoughnessMetallic.png b/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..1c547c3deb9271a267acf321a3c414cc2b404e27 --- /dev/null +++ b/assets/saftey_helmet/simready_usd/textures/T_Plastic_HDPE_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22ceb2415387f0e5c8bd0f49a1734f2865d2e96a9c2304a94bcb4883ba6285bf +size 1824680 diff --git a/assets/scraper/simready_usd/.simready/validation.json b/assets/scraper/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..32c7579026033d33f74ebd891439ace860219898 --- /dev/null +++ b/assets/scraper/simready_usd/.simready/validation.json @@ -0,0 +1,174 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd.png b/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..1fea5b26518644b14a74065b2c63d8249cb35456 --- /dev/null +++ b/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1a831d1f09e5fa80aba1fee8acd158e03ecf1cb50c098c4aad45ffda7c02f1f +size 51369 diff --git a/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd_light.png b/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..e574cab2eb467673a2b35baf07180796e6e3b861 --- /dev/null +++ b/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d06964327d7ea3954f42ff6174bfcf7b9df91975409235c941e2ca77e63c20ef +size 32459 diff --git a/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd_transparent.png b/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..60234b269ebb63bcd6f3f95522392c0e1d6cde5b --- /dev/null +++ b/assets/scraper/simready_usd/.thumbs/256x256/scraper.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6386d9986e6e18a84f5a70dda0ffeefcc71fdf5cbee6a1f626a33a7f04bd903 +size 26912 diff --git a/assets/scraper/simready_usd/materials/OmniPBR.mdl b/assets/scraper/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/scraper/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/scraper/simready_usd/materials/OmniPBRBase.mdl b/assets/scraper/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/scraper/simready_usd/materials/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/assets/scraper/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/scraper/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/scraper/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/scraper/simready_usd/scraper.usd b/assets/scraper/simready_usd/scraper.usd new file mode 100644 index 0000000000000000000000000000000000000000..7032c9ed77f760f27627732fe8c532306cf2ccc2 --- /dev/null +++ b/assets/scraper/simready_usd/scraper.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a5317a3f48d92959659990aab1c87ddf788bdbce4015b562d0113a62287b20f +size 613537 diff --git a/assets/scraper/simready_usd/textures/M_scraper_BaseColor.png b/assets/scraper/simready_usd/textures/M_scraper_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..50c1fcb25e1ac8cfc3052dc0c1154dcd62b2afa5 --- /dev/null +++ b/assets/scraper/simready_usd/textures/M_scraper_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f03e956c00564254a52271806597277d0c1e33ec663593f6aec1b293b335708b +size 4880335 diff --git a/assets/scraper/simready_usd/textures/M_scraper_Normal.png b/assets/scraper/simready_usd/textures/M_scraper_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..149f3afdb21e17f8c0eef9a3573dddb27e3f6bfa --- /dev/null +++ b/assets/scraper/simready_usd/textures/M_scraper_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d34c305e1f641a019d426a8416905e96d8864b9ccfdccf2ab16976f1a0a8c13 +size 3173044 diff --git a/assets/scraper/simready_usd/textures/M_scraper_OcclusionRoughnessMetallic.png b/assets/scraper/simready_usd/textures/M_scraper_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..57eece3c442495e40a5d9540c6e28430789e0a49 --- /dev/null +++ b/assets/scraper/simready_usd/textures/M_scraper_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15662df822d2d0bbe21bb20a8bc15db85ff8fad67289ccc0a3f7bf6092f7d434 +size 2794760 diff --git a/assets/screwdriver/simready_usd/.simready/validation.json b/assets/screwdriver/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..32c7579026033d33f74ebd891439ace860219898 --- /dev/null +++ b/assets/screwdriver/simready_usd/.simready/validation.json @@ -0,0 +1,174 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd.png b/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..ab0b989633cafe6feb20efbba084c5babd19b17b --- /dev/null +++ b/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adc18e4e2bec6ca381bcdb8496c0444b834b76f9451eed77224e476fd8f163a1 +size 47543 diff --git a/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd_light.png b/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..d02df4682eea24a13c7b7d9753a579481a063327 --- /dev/null +++ b/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3aa2b793d89e978b025ffa8919a14fe0c707cbbe6b2946948ca1f1971483ccd +size 25268 diff --git a/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd_transparent.png b/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..8ee720088cceeb5ca715f23e8e5ca00a132fc6c0 --- /dev/null +++ b/assets/screwdriver/simready_usd/.thumbs/256x256/screwdriver.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fc7830ae80b1d62e2a9f0cf86f6d850747bbdb0d521d8e79f053b9fe05b749f +size 19335 diff --git a/assets/screwdriver/simready_usd/materials/OmniPBR.mdl b/assets/screwdriver/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/screwdriver/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/screwdriver/simready_usd/materials/OmniPBRBase.mdl b/assets/screwdriver/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/screwdriver/simready_usd/materials/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/assets/screwdriver/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/screwdriver/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/screwdriver/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/screwdriver/simready_usd/screwdriver.usd b/assets/screwdriver/simready_usd/screwdriver.usd new file mode 100644 index 0000000000000000000000000000000000000000..9bf0d6be5e0c5d6c00fb70fda1d486ca2527b077 --- /dev/null +++ b/assets/screwdriver/simready_usd/screwdriver.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa558071d575226764cb5ff43514ceb2912bd37bf5a3d0e71980063891453422 +size 353553 diff --git a/assets/screwdriver/simready_usd/textures/M_screwdriver_BaseColor.png b/assets/screwdriver/simready_usd/textures/M_screwdriver_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..128d6e0f92438c2ad099ed4d56d7f02af010ca31 --- /dev/null +++ b/assets/screwdriver/simready_usd/textures/M_screwdriver_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17ce5561b0ffa68e3b0a7304cedae0316f0412ecb688809497342dc414eb2959 +size 2969233 diff --git a/assets/screwdriver/simready_usd/textures/M_screwdriver_Normal.png b/assets/screwdriver/simready_usd/textures/M_screwdriver_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..367f088ee554dc6fcdd4d68fee593c500cb186be --- /dev/null +++ b/assets/screwdriver/simready_usd/textures/M_screwdriver_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee6c2c6abb1629027e81d1546b8a32e7b6303e9718280955e5d4929aa2b7aa28 +size 6951740 diff --git a/assets/screwdriver/simready_usd/textures/M_screwdriver_OcclusionRoughnessMetallic.png b/assets/screwdriver/simready_usd/textures/M_screwdriver_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..b72ba2e0cc6b7fb6c1854e793d064c97b0e4b466 --- /dev/null +++ b/assets/screwdriver/simready_usd/textures/M_screwdriver_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcba2f9899549b2508fb8d900b72118c08cf867e4d631af5df7d4a4c5bc1ac69 +size 3313873 diff --git a/assets/shovel/simready_usd/.simready/validation.json b/assets/shovel/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..14b4b14ef1fb917401af651446e114e40959084d --- /dev/null +++ b/assets/shovel/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd.png b/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..dc4e1683e22124b1ca085e4179dff453b6ba7aca --- /dev/null +++ b/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb590827766dbb809865cfa8956e1acb7cbf94eadce2e557cb73604301ee0a44 +size 45523 diff --git a/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd_light.png b/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..e631f7cd35f92f74df95c460ef05aff4680fbff0 --- /dev/null +++ b/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b804a45bfc0e6c7de7258c8513bc2a44ff71056ffa17333265adbd5999b978e +size 22091 diff --git a/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd_transparent.png b/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..756985befa515582136cb6ae9664520980118614 --- /dev/null +++ b/assets/shovel/simready_usd/.thumbs/256x256/shovel.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70951eedcd06e3f253e92a6db30d35e9600b1b4120092986348fa28702cd6ebe +size 16193 diff --git a/assets/shovel/simready_usd/materials/OmniPBR.mdl b/assets/shovel/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/shovel/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/shovel/simready_usd/materials/OmniPBRBase.mdl b/assets/shovel/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/shovel/simready_usd/materials/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/assets/shovel/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/shovel/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/shovel/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/shovel/simready_usd/post_validation.json b/assets/shovel/simready_usd/post_validation.json new file mode 100644 index 0000000000000000000000000000000000000000..3814c4bc74d764c12d1c916d6d9389fa5eb67f6d --- /dev/null +++ b/assets/shovel/simready_usd/post_validation.json @@ -0,0 +1,18 @@ +{ + "C:/srtest/2nd/pkg_repo/.packages/shovel/1.0.0/Shovel.usd": { + "features_summary": { + "FET030_PACKAGING_CORE": { + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET032_PACKAGING_INTROSPECTION": { + "dependencies": "[{'FET030_PACKAGING_CORE': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.1.0" + } + }, + "profile_id": "Package", + "profile_version": "1.0.0" + } +} \ No newline at end of file diff --git a/assets/shovel/simready_usd/shovel.usd b/assets/shovel/simready_usd/shovel.usd new file mode 100644 index 0000000000000000000000000000000000000000..c064169a29e6ef4324ae3e5f15bd7b382d70c0b4 --- /dev/null +++ b/assets/shovel/simready_usd/shovel.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f15f4fda51335cf7e3ef77080201dc3291ee863b7e2a68ed3a97fb75182f6c7 +size 3143596 diff --git a/assets/shovel/simready_usd/textures/T_Steel_BaseColor.png b/assets/shovel/simready_usd/textures/T_Steel_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..fc05aa1f4703b3da7f3011f8df2e126ffe770114 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Steel_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c83d531c6cf49f3bd154c40e1e286438b65a8b55200ba7e4c720e6147e690b13 +size 16903 diff --git a/assets/shovel/simready_usd/textures/T_Steel_Carbon_BaseColor.png b/assets/shovel/simready_usd/textures/T_Steel_Carbon_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..7e5816684f93c6eea68182d7f406d9a285270dc6 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Steel_Carbon_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9da8aebf25e43ea95ea5f17967edfb5679f925c5e64f36acc002a075b8dd9b83 +size 1290844 diff --git a/assets/shovel/simready_usd/textures/T_Steel_Carbon_Normal.png b/assets/shovel/simready_usd/textures/T_Steel_Carbon_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..54947ca73851a9dacda012ffb5bb70c0efb57b9c --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Steel_Carbon_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:774c18525e82fc465e8717ee2941b7306b57f90c1a4f3fa4b20e79761463557e +size 2454275 diff --git a/assets/shovel/simready_usd/textures/T_Steel_Carbon_OcclusionRoughnessMetallic.png b/assets/shovel/simready_usd/textures/T_Steel_Carbon_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..b1784867e60b15876b12a75fe8db5eb3fd605b11 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Steel_Carbon_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:218f1c04db8d4d47baab644f624c29f7173511b1463e0e14829dcf978f47da65 +size 2107943 diff --git a/assets/shovel/simready_usd/textures/T_Steel_Normal.png b/assets/shovel/simready_usd/textures/T_Steel_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..e2194d5220a88caa9d5e0dcb5cb635a0f565b8b3 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Steel_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c46962e7ccda0d949d0239e2d7617870ffafa70002db2596373ea28eb6bfe58b +size 2199767 diff --git a/assets/shovel/simready_usd/textures/T_Steel_OcclusionRoughnessMetallic.png b/assets/shovel/simready_usd/textures/T_Steel_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..8c325ff1507358aa7129df0349b245d536115b71 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Steel_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9511c7a7d5729fe4786afab2df8e769a243e5825076c02c283a8ec47eb3b5ff +size 194836 diff --git a/assets/shovel/simready_usd/textures/T_Wood_Ash_BaseColor.png b/assets/shovel/simready_usd/textures/T_Wood_Ash_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..05164e17f6ff33b31622ac69c23813fc3c85ab2e --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Wood_Ash_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28c7ae7109825312abc663426093ff6ce05e045c63e2f86ca3eb551bb2598478 +size 1293104 diff --git a/assets/shovel/simready_usd/textures/T_Wood_Ash_Normal.png b/assets/shovel/simready_usd/textures/T_Wood_Ash_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..a391059138b4fad3c8570b3eafcdd2c78aab3752 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Wood_Ash_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7dda21d3ad89b9145893278fa83f4e882806897ea682186f7594231463cb4c5 +size 4713340 diff --git a/assets/shovel/simready_usd/textures/T_Wood_Ash_OcclusionRoughnessMetallic.png b/assets/shovel/simready_usd/textures/T_Wood_Ash_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..2702b1a1331390731d5d791d74cadcaaf4a72627 --- /dev/null +++ b/assets/shovel/simready_usd/textures/T_Wood_Ash_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:647339faada0305ef11549817fb0e64173a68e645437aafce1532291441087ac +size 258011 diff --git a/assets/signal_tower/simready_usd/.simready/validation.json b/assets/signal_tower/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..32c7579026033d33f74ebd891439ace860219898 --- /dev/null +++ b/assets/signal_tower/simready_usd/.simready/validation.json @@ -0,0 +1,174 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd.png b/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..a1eb2b941be0489c479a73bfca88fa0bb614399e --- /dev/null +++ b/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc121bd5e426d6511b967924d1268b09ba34e4fc7b5ac2cc69c3289636a8bd8a +size 38810 diff --git a/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd_light.png b/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..90a887b7d911e8e0e2e2b8719328b281d2e1b568 --- /dev/null +++ b/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b3533af1e9cc8998610d452a7499ba5dfb28999900d7b94dcf500b45e73c23b +size 23059 diff --git a/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd_transparent.png b/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..dd1685386bb309e68514795ee874f5896edac3eb --- /dev/null +++ b/assets/signal_tower/simready_usd/.thumbs/256x256/signal_tower.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:265d830f22efb58edf7099481047f6e268053bf18e872d1a1e8387a952e145e1 +size 17737 diff --git a/assets/signal_tower/simready_usd/materials/Light_1900K.mdl b/assets/signal_tower/simready_usd/materials/Light_1900K.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3811b871c5ac17082803cd281cbd38dd4e7ebb3c --- /dev/null +++ b/assets/signal_tower/simready_usd/materials/Light_1900K.mdl @@ -0,0 +1,42 @@ +mdl 1.4; + +using ::OmniPBR import OmniPBR; +import ::tex::gamma_mode; +import ::state::normal; + +export material Light_1900K(*) + = OmniPBR( + diffuse_color_constant: color(1.0, 1.0, 1.0), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 1.0, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.0, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(1.0, 0.51373, 0.0), + emissive_mask_texture: texture_2d(), + emissive_intensity: 5000.0, + bump_factor: 0.f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.3f, + detail_normalmap_texture: texture_2d(), + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/signal_tower/simready_usd/materials/OmniPBR.mdl b/assets/signal_tower/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/signal_tower/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/signal_tower/simready_usd/materials/OmniPBRBase.mdl b/assets/signal_tower/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/signal_tower/simready_usd/materials/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/assets/signal_tower/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/signal_tower/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/signal_tower/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/signal_tower/simready_usd/signal_tower.usd b/assets/signal_tower/simready_usd/signal_tower.usd new file mode 100644 index 0000000000000000000000000000000000000000..0eb485ac483f0d5a2e84a95f57f8707d2c8af28b --- /dev/null +++ b/assets/signal_tower/simready_usd/signal_tower.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa1b573247b8da9a9a996ec32431becc52a19bfdb51e00d7a3906b1938356ba4 +size 8064039 diff --git a/assets/signal_tower/simready_usd/textures/M_signal_tower_BaseColor.png b/assets/signal_tower/simready_usd/textures/M_signal_tower_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..618c06ce9a8166092dcab57884763feb80017f95 --- /dev/null +++ b/assets/signal_tower/simready_usd/textures/M_signal_tower_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5b949f377d4314fc724ca1d40e230ae2ccde4823391b046c132aec2515839e3 +size 1038949 diff --git a/assets/signal_tower/simready_usd/textures/M_signal_tower_Emissive.png b/assets/signal_tower/simready_usd/textures/M_signal_tower_Emissive.png new file mode 100644 index 0000000000000000000000000000000000000000..47212d51f305e2090621a2b744a9fdcec41c0fe7 --- /dev/null +++ b/assets/signal_tower/simready_usd/textures/M_signal_tower_Emissive.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeecfe7e17a0a9d8e7b13d95ac8132b6209cbc508bc85e462d86937c693841cf +size 25342 diff --git a/assets/signal_tower/simready_usd/textures/M_signal_tower_Normal.png b/assets/signal_tower/simready_usd/textures/M_signal_tower_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..6d56528d888b71ea64af17757a2a92a3ff3704e0 --- /dev/null +++ b/assets/signal_tower/simready_usd/textures/M_signal_tower_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0eb67e7fcf1126f3804024ff7eb457b5b3fa0e8b39344a94c0ed0a8e6def8236 +size 3882109 diff --git a/assets/signal_tower/simready_usd/textures/M_signal_tower_OcclusionRoughnessMetallic.png b/assets/signal_tower/simready_usd/textures/M_signal_tower_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..477b84f972ceba3a2918e16091c83f2fbbca63bb --- /dev/null +++ b/assets/signal_tower/simready_usd/textures/M_signal_tower_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8ee05ee0f96562cf8442cf522177e0f291abd3403f6d657dae842953a3e7581 +size 2385677 diff --git a/assets/spanner/simready_usd/.simready/validation.json b/assets/spanner/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..14b4b14ef1fb917401af651446e114e40959084d --- /dev/null +++ b/assets/spanner/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd.png b/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..fec3d475cd8dbac5f9f6263acfcc1e2abc69deb9 --- /dev/null +++ b/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc5dea2ddc618b66f0a50c9772ae92c001180b36e7500acdb48c352dd368ed19 +size 54174 diff --git a/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd_light.png b/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..57c591c78137e3a9322503aa1c8d053076222fef --- /dev/null +++ b/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33cbfb19546efdb857ba69eeee98e73499238e7de1055c89755b7c6207d63118 +size 30372 diff --git a/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd_transparent.png b/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..9e26c5a1b9ee7893a8c38a5b1b67960a1a0a29da --- /dev/null +++ b/assets/spanner/simready_usd/.thumbs/256x256/spanner.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:297b1d4566afbd88178b757dda014059986aaf66012c3a31c92fa5960b7da575 +size 26701 diff --git a/assets/spanner/simready_usd/materials/OmniPBR.mdl b/assets/spanner/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/spanner/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/spanner/simready_usd/materials/OmniPBRBase.mdl b/assets/spanner/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/spanner/simready_usd/materials/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/assets/spanner/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/spanner/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/spanner/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/spanner/simready_usd/spanner.usd b/assets/spanner/simready_usd/spanner.usd new file mode 100644 index 0000000000000000000000000000000000000000..d04d202ef3720726511c763eb71b211011e34963 --- /dev/null +++ b/assets/spanner/simready_usd/spanner.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf9984d2ad33c7a45323c4b390e05df22ac34535478d96bfcee5683f2e9a9019 +size 163700 diff --git a/assets/spanner/simready_usd/textures/T_Spanner_BaseColor.png b/assets/spanner/simready_usd/textures/T_Spanner_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..e30b14bff1a0265e61f74b7217c4115eb7b89ec8 --- /dev/null +++ b/assets/spanner/simready_usd/textures/T_Spanner_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12ce1aa3cb239c986b6abe739320d0a3124c208f032c1d21b22675eed5a45ed0 +size 2081565 diff --git a/assets/spanner/simready_usd/textures/T_Spanner_Normal.png b/assets/spanner/simready_usd/textures/T_Spanner_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..3d1e4b666444a1b10187763b60c46d436585c4ce --- /dev/null +++ b/assets/spanner/simready_usd/textures/T_Spanner_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fabdf60bbd4b714f38cfbc3807844ac4d7ad13e4eea7ec20b40e705cf48c22ff +size 2011504 diff --git a/assets/spanner/simready_usd/textures/T_Spanner_OcclusionRoughnessMetallic.png b/assets/spanner/simready_usd/textures/T_Spanner_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..9ae5d798f7072ae873faed5170fdb60f0d5fdcf9 --- /dev/null +++ b/assets/spanner/simready_usd/textures/T_Spanner_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9d24e2ea3dc8aac53c23f5213c0e9ddbc9281e1765fe8fc4e843c071436dc02 +size 2381677 diff --git a/assets/steel_drum/simready_usd/.simready/validation.json b/assets/steel_drum/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..14b4b14ef1fb917401af651446e114e40959084d --- /dev/null +++ b/assets/steel_drum/simready_usd/.simready/validation.json @@ -0,0 +1,176 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001', 'com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "optional requirements": "['com.nvidia.simready.RB.MB.001']", + "passed": false, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd.png b/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..cd98a9dc6ab7c9552268970414d80e90670ae92d --- /dev/null +++ b/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5250b1119184a35a8e2d9cef05bf6cd232ff6b12b2d72ccc217b6d80ec4e35b1 +size 49768 diff --git a/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd_light.png b/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..d25f1b658a73c5051fb74f4105ef5052e376bf08 --- /dev/null +++ b/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e2486072e85cbc09c8e7b45bf7c3a779b10d66fa421318d9b42e71af2c1ac25 +size 54041 diff --git a/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd_transparent.png b/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..43538c60dc4ed45bae25d512fc84cea9b8010269 --- /dev/null +++ b/assets/steel_drum/simready_usd/.thumbs/256x256/steel_drum.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8500ec060bedb10ce2230e35064a4e8a86adb3464284c163cf51e348ccf29118 +size 44652 diff --git a/assets/steel_drum/simready_usd/materials/OmniPBR.mdl b/assets/steel_drum/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/steel_drum/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/steel_drum/simready_usd/materials/OmniPBRBase.mdl b/assets/steel_drum/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/steel_drum/simready_usd/materials/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/assets/steel_drum/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/steel_drum/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/steel_drum/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/steel_drum/simready_usd/steel_drum.usd b/assets/steel_drum/simready_usd/steel_drum.usd new file mode 100644 index 0000000000000000000000000000000000000000..e382e390115e4bbd27c4ec693f334cfa0ff2d768 --- /dev/null +++ b/assets/steel_drum/simready_usd/steel_drum.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5552c41b72b4244f12bc0f7018304168b0b4930f4b2b13b9e67f9ecb7aeb6cf +size 3203485 diff --git a/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_BaseColor.png b/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..b087464dd55622625ee3f196e60ffc896e51e50b --- /dev/null +++ b/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f9220862d8a6e2a001d755ba7b7a4c9c9257445712059ab9e3a449341180209 +size 502995 diff --git a/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_Normal.png b/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..49445eb6031df929c0bbfe8374cacae43395bdce --- /dev/null +++ b/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ec2eaa5e90c5b6bcf751d5c48f98589d3985dd1aab314e037c85067dff9cc1 +size 2278367 diff --git a/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_OcclusionRoughnessMetallic.png b/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..7c23a760bad204a43b74dd7cceec9384717a5923 --- /dev/null +++ b/assets/steel_drum/simready_usd/textures/T_Plastic_Matte_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ed7f4db00543f70ae503e5620b7acc35288ea5daf89344ddf3cc3b536f2727f +size 745245 diff --git a/assets/steel_drum/simready_usd/textures/T_Steel_Painted_BaseColor.png b/assets/steel_drum/simready_usd/textures/T_Steel_Painted_BaseColor.png new file mode 100644 index 0000000000000000000000000000000000000000..7e5ed16a4f1305cb9a2c7e2f521d61d518810658 --- /dev/null +++ b/assets/steel_drum/simready_usd/textures/T_Steel_Painted_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6cbd2402b7b8ae825d4c9c15bc0491d8b9794cb2864a8d3625aab7b7f0f824f +size 1732911 diff --git a/assets/steel_drum/simready_usd/textures/T_Steel_Painted_Normal.png b/assets/steel_drum/simready_usd/textures/T_Steel_Painted_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..6d2dc932db58af190458fa88ed34de07f0c45cf6 --- /dev/null +++ b/assets/steel_drum/simready_usd/textures/T_Steel_Painted_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9508d60a227978145b1347af4b8bf5007e52ae35466bc2e7d3643673a6fd15ff +size 2181100 diff --git a/assets/steel_drum/simready_usd/textures/T_Steel_Painted_OcclusionRoughnessMetallic.png b/assets/steel_drum/simready_usd/textures/T_Steel_Painted_OcclusionRoughnessMetallic.png new file mode 100644 index 0000000000000000000000000000000000000000..55f36d90db6b87db93abf8deae09d6e9ffb4d2d0 --- /dev/null +++ b/assets/steel_drum/simready_usd/textures/T_Steel_Painted_OcclusionRoughnessMetallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b61ff96e14e09d9f08b7999f0b3176dcadc7c37f3dd653fb1fab58e534c73523 +size 2602243 diff --git a/assets/storage_rack/simready_usd/.simready/validation.json b/assets/storage_rack/simready_usd/.simready/validation.json new file mode 100644 index 0000000000000000000000000000000000000000..32c7579026033d33f74ebd891439ace860219898 --- /dev/null +++ b/assets/storage_rack/simready_usd/.simready/validation.json @@ -0,0 +1,174 @@ +{ + "SimReady_Metadata": { + "validation": { + "profile": "Robotics-Prop", + "profile_version": "4.0.0", + "validated_features": { + "2026-10-30": { + "FET_000_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.007']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.004']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_000_STANDARD': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.RV.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_000_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_001_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "1.0.1" + }, + "FET_003_MUJOCO": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_NEWTON": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_003_PHYSX": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.4.0" + }, + "FET_003_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_004_MUJOCO": { + "blocking_failure": false, + "dependencies": "[{'FET_003_MUJOCO': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.MUJOCO.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_NEWTON": { + "blocking_failure": false, + "dependencies": "[{'FET_003_NEWTON': {'version': '0.1.0'}}]", + "optional requirements": "['com.nvidia.simready.NEWTON.COL.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_004_PHYSX": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_004_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_003_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.2.0" + }, + "FET_005_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.GSP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_MDL": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_006_OPENPBR": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.VM.PBR.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_006_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_007_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.NVM.001', 'com.nvidia.simready.NVM.002', 'com.nvidia.simready.NVM.003']", + "passed": false, + "version": "0.2.0" + }, + "FET_010_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "optional requirements": "['com.nvidia.simready.DISP.001']", + "passed": false, + "version": "0.1.0" + }, + "FET_011_RTX": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_011_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.2.0" + }, + "FET_031_STANDARD": { + "blocking_failure": false, + "dependencies": "[]", + "passed": true, + "version": "0.1.0" + }, + "FET_033_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]", + "passed": true, + "version": "0.4.0" + }, + "FET_046_STANDARD": { + "blocking_failure": false, + "dependencies": "[{'FET_011_STANDARD': {'version': '0.2.0'}}]", + "passed": true, + "version": "0.1.0" + }, + "FET_100_ISAAC": { + "blocking_failure": false, + "dependencies": "[{'FET_003_PHYSX': {'version': '0.4.0'}}]", + "optional requirements": "['com.nvidia.simready.ISA.001']", + "passed": false, + "version": "0.4.0" + } + } + } + } + } +} diff --git a/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd.png b/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd.png new file mode 100644 index 0000000000000000000000000000000000000000..c16f15033a2a0789381c9d6b8290118459ecc87d --- /dev/null +++ b/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1523d1a67666799c0324c3e95aef1c0b0c877ae62e06e04f5e44d0f5b5998e5d +size 61704 diff --git a/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd_light.png b/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd_light.png new file mode 100644 index 0000000000000000000000000000000000000000..b89708f02cde6b47dddb255baab250542e723504 --- /dev/null +++ b/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd_light.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1271fd6b7f7d65d064127f73ac047883bef072f9d923fb6f0564335a15592eda +size 53554 diff --git a/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd_transparent.png b/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd_transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..52bb26dfc0d0453691074afd1e350993dfcae78d --- /dev/null +++ b/assets/storage_rack/simready_usd/.thumbs/256x256/storage_rack.usd_transparent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:628e37ef1a28bda89eb43cf98fe1123224a3015ae5de45c20aec1e6bfbd5d491 +size 43408 diff --git a/assets/storage_rack/simready_usd/materials/OmniPBR.mdl b/assets/storage_rack/simready_usd/materials/OmniPBR.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2937decbf0c38e1175d499a0ad2ca3a311c470a4 --- /dev/null +++ b/assets/storage_rack/simready_usd/materials/OmniPBR.mdl @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +mdl 1.7; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::base::*; +import ::state::*; +import ::tex::*; +import ::anno::*; + +import ::debug::*; + +import ::nvidia::core_definitions::file_texture; +import ::nvidia::core_definitions::normalmap_texture; + +import OmniPBR_ClearCoat::*; + + +// OmniPBR // + +export material OmniPBR( + + // Albdeo // + + color diffuse_color_constant = color(0.2) [[ + anno::display_name("Albedo Color"), + anno::description("This is the albedo base color"), + anno::in_group("Albedo") + ]], + uniform texture_2d diffuse_texture = texture_2d() [[ + anno::display_name("Albedo Map"), + anno::in_group("Albedo") + ]], + float albedo_desaturation = float(0.0) [[ + anno::display_name("Albedo Map Desaturation"), + anno::description("Desaturates the albedo map"), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + float albedo_add = float(0.0) [[ + anno::display_name("Albedo Add"), + anno::description("Adds a constant value to the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(-1.0), float(1.0)) + ]], + float albedo_brightness = float(1.0) [[ + anno::display_name("Albedo Brightness"), + anno::description("Multiplier for the diffuse color "), + anno::in_group("Albedo"), + anno::soft_range(float(0.0), float(1.0)) + ]], + color diffuse_tint = color(1.0) [[ + anno::display_name("Color Tint"), + anno::description("When enabled, this color value is multiplied over the final albedo color"), + anno::in_group("Albedo") + ]], + + + // Reflectivity // + + float reflection_roughness_constant = float(0.5) [[ + anno::display_name("Roughness Amount"), + anno::description("Higher roughness values lead to more blurry reflections"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float reflection_roughness_texture_influence = float(0.0) [[ + anno::display_name("Roughness Map Influence"), + anno::description("Blends between the constant value and the lookup of the roughness texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d reflectionroughness_texture = texture_2d() [[ + anno::display_name("Roughness Map"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + float metallic_constant = float(0.0) [[ + anno::display_name("Metallic Amount"), + anno::description("Metallic Material"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + float metallic_texture_influence = float(0.0) [[ + anno::display_name("Metallic Map Influence"), + anno::description("Blends between the constant value and the lookup of the metallic texture"), + anno::in_group("Reflectivity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d metallic_texture = texture_2d() [[ + anno::display_name("Metallic Map"), + anno::in_group("Reflectivity"), + anno::usage("metalness") + ]], + float specular_level = float(0.5) [[ + anno::display_name("Specular"), + anno::description("The specular level (intensity) of the material"), + anno::in_group("Reflectivity"), + anno::soft_range(float(0.0), float(1.0)) + ]], + + + // ORM // + + uniform bool enable_ORM_texture = false [[ + anno::display_name("Enable ORM Texture"), + anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"), + anno::in_group("Reflectivity") + ]], + uniform texture_2d ORM_texture = texture_2d() [[ + anno::display_name("ORM Map"), + anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"), + anno::in_group("Reflectivity"), + anno::usage("roughness") + ]], + + + // AO Group // + + float ao_to_diffuse = 0.0 [[ + anno::display_name("AO to diffuse"), + anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"), + anno::in_group("AO"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform texture_2d ao_texture = texture_2d() [[ + anno::display_name("Ambient Occlusion Map"), + anno::description("The ambient occlusion texture for the material"), + anno::in_group("AO"), + anno::usage("occlusion") + ]], + + + // Emission // + + uniform bool enable_emission = false [[ + anno::display_name("Enable Emission"), + anno::description("Enables the emission of light from the material"), + anno::in_group("Emissive") + ]], + color emissive_color = color(1.0,0.1,0.1) [[ + anno::display_name("Emissive Color"), + anno::description("The emission color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_color_texture = texture_2d() [[ + anno::display_name("Emissive Color map"), + anno::in_group("Emissive"), + anno::description("The emissive color texture"), + anno::enable_if("enable_emission == true") + ]], + uniform texture_2d emissive_mask_texture = texture_2d() [[ + anno::display_name("Emissive Mask map"), + anno::description("The texture masking the emissive color"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true"), + anno::usage("occlusion") + ]], + float emissive_intensity = float(40.0) [[ + anno::display_name("Emissive Intensity"), + anno::description("Intensity of the emission"), + anno::in_group("Emissive"), + anno::enable_if("enable_emission == true") + ]], + + + // Cutout Opacity // + + uniform bool enable_opacity = false [[ + anno::display_name("Enable Opacity"), + anno::description("Enables the use of cutout opacity"), + anno::in_group("Opacity") + ]], + uniform texture_2d opacity_texture = texture_2d() [[ + anno::display_name("Opacity Map"), + anno::in_group("Opacity"), + anno::usage("opacity") + ]], + float opacity_constant = float(1.0) [[ + anno::display_name("Opacity Amount"), + anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"), + anno::in_group("Opacity"), + anno::hard_range(float(0.0), float(1.0)) + ]], + uniform bool enable_opacity_texture = false [[ + anno::display_name("Enable Opacity Texture"), + anno::description("Enables or disables the usage of the opacity texture map"), + anno::in_group("Opacity") + ]], + uniform base::mono_mode opacity_mode = base::mono_average [[ + anno::display_name("Opacity Mono Source"), + anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"), + anno::in_group("Opacity") + ]], + uniform float opacity_threshold = float(0.0) [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Opacity Threshold"), + anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"), + anno::in_group("Opacity") + ]], + + + // Normal // + + uniform float geometry_normal_roughness_strength = 1.f + [[ + anno::hard_range(0.0, 1.0), + anno::display_name("Normal map to roughness weight"), + anno::description("Enables and weights roughness induced by normal maps"), + anno::in_group("Normal") + ]], + uniform float bump_factor = float(1.0) [[ + anno::display_name("Normal Strength"), + anno::description("Strength of normal map"), + anno::in_group("Normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d normalmap_texture = texture_2d() [[ + anno::display_name("Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform float detail_bump_factor = float(0.3) [[ + anno::display_name("Detail Normal Strength"), + anno::in_group("Normal"), + anno::description("Strength of the detail normal"), + anno::soft_range(float(0.0), float(1.0)) + ]], + uniform texture_2d detail_normalmap_texture = texture_2d() [[ + anno::display_name("Detail Normal Map"), + anno::in_group("Normal"), + anno::usage("normal") + ]], + uniform bool flip_tangent_u = false [[ + anno::display_name("Normal Map Flip U Tangent"), + anno::in_group("Normal") + ]], + uniform bool flip_tangent_v = true [[ + anno::display_name("Normal Map Flip V Tangent"), + anno::in_group("Normal") + ]], + + + // UVW Projection Group // + + uniform bool project_uvw = false [[ + anno::display_name("Enable Project UVW Coordinates"), + anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), + anno::in_group("UV") + ]], + uniform bool world_or_object = false [[ + anno::display_name("Enable World Space"), + anno::description("When enabled, uses world space for projection, otherwise object space is used"), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform int uv_space_index = 0 [[ + anno::display_name("UV Space Index"), + anno::description("UV Space Index."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true"), + anno::hard_range(int(0), int(3)) + ]], + + + // UVW Adjustments Group // + + uniform float2 texture_translate = float2(0.0) [[ + anno::display_name("Texture Translate"), + anno::description("Controls position of texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float texture_rotate = float(0.0) [[ + anno::display_name("Texture Rotate"), + anno::description("Rotates angle of texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 texture_scale = float2(1.0) [[ + anno::display_name("Texture Tiling"), + anno::description("Controls the repetition of the texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_translate = float2(0.0) [[ + anno::display_name("Detail Texture Translate"), + anno::description("Controls the position of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float detail_texture_rotate = float(0.0) [[ + anno::display_name("Detail Texture Rotate"), + anno::description("Rotates angle of the detail texture in degrees."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + uniform float2 detail_texture_scale = float2(1.0) [[ + anno::display_name("Detail Texture Tiling"), + anno::description("Controls the repetition of the detail texture."), + anno::in_group("UV"), + anno::enable_if("project_uvw == true") + ]], + + + // Geometry // + + uniform float round_edges_radius = float(0.0) [[ + anno::display_name("Round Edge Radius"), + anno::description("Influence radius around the edges in meters"), + anno::in_group("Geometry"), + anno::soft_range(0.0, 1.0) + ]], + uniform float round_edges_roundness = float(1.0) [[ + anno::display_name("Round Edge Roundness"), + anno::description("Determines how round the edge will look"), + anno::in_group("Geometry"), + anno::hard_range(0.0, 1.0) + ]], + uniform bool round_edges_across_materials = false [[ + anno::display_name("Round Edge Across Materials"), + anno::description("Normal smoothing happens only between facets of equal material, \n" + "\t\tunless this parameter is set true, in which case the smoothing \n" + "\t\thappens between facets irrespective of their materials"), + anno::in_group("Geometry") + ]] +) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base"), + anno::version( 2, 1, 2), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] = let { + +material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat( + diffuse_color_constant: diffuse_color_constant, + diffuse_texture: diffuse_texture, + albedo_desaturation: albedo_desaturation, + albedo_add: albedo_add, + albedo_brightness: albedo_brightness, + diffuse_tint: diffuse_tint, + reflection_roughness_constant: reflection_roughness_constant, + reflection_roughness_texture_influence: reflection_roughness_texture_influence, + reflectionroughness_texture: reflectionroughness_texture, + metallic_constant: metallic_constant, + metallic_texture_influence: metallic_texture_influence, + metallic_texture: metallic_texture, + specular_level: specular_level, + enable_ORM_texture: enable_ORM_texture, + ORM_texture: ORM_texture, + ao_to_diffuse: ao_to_diffuse, + ao_texture: ao_texture, + enable_emission: enable_emission, + emissive_color: emissive_color, + emissive_color_texture: emissive_color_texture, + emissive_mask_texture: emissive_mask_texture, + emissive_intensity: emissive_intensity, + enable_opacity: enable_opacity, + opacity_texture: opacity_texture, + opacity_constant: opacity_constant, + enable_opacity_texture: enable_opacity_texture, + opacity_mode: opacity_mode, + opacity_threshold: opacity_threshold, + geometry_normal_roughness_strength: geometry_normal_roughness_strength, + bump_factor: bump_factor, + normalmap_texture: normalmap_texture, + detail_bump_factor: detail_bump_factor, + detail_normalmap_texture: detail_normalmap_texture, + flip_tangent_u: flip_tangent_u, + flip_tangent_v: flip_tangent_v, + project_uvw: project_uvw, + world_or_object: world_or_object, + uv_space_index: uv_space_index, + texture_translate: texture_translate, + texture_rotate: texture_rotate, + texture_scale: texture_scale, + detail_texture_translate: detail_texture_translate, + detail_texture_rotate: detail_texture_rotate, + detail_texture_scale: detail_texture_scale, + round_edges_radius: round_edges_radius, + round_edges_roundness: round_edges_roundness, + round_edges_across_materials: round_edges_across_materials +); + +} in material( +surface: base.surface, +geometry: base.geometry +); diff --git a/assets/storage_rack/simready_usd/materials/OmniPBRBase.mdl b/assets/storage_rack/simready_usd/materials/OmniPBRBase.mdl new file mode 100644 index 0000000000000000000000000000000000000000..417cec0a705f3ed09ceded3f85f5b919acf8dd20 --- /dev/null +++ b/assets/storage_rack/simready_usd/materials/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/assets/storage_rack/simready_usd/materials/OmniPBR_ClearCoat.mdl b/assets/storage_rack/simready_usd/materials/OmniPBR_ClearCoat.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a3128e6bae5402a39d620cda0f6fa7f3a766ec1 --- /dev/null +++ b/assets/storage_rack/simready_usd/materials/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 ::nvidia::core_definitions::file_texture; +import ::nvidia::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/assets/storage_rack/simready_usd/storage_rack.usd b/assets/storage_rack/simready_usd/storage_rack.usd new file mode 100644 index 0000000000000000000000000000000000000000..d5403c79d26aa597754212037da2608ba0b4d477 --- /dev/null +++ b/assets/storage_rack/simready_usd/storage_rack.usd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edbe35b00f571a908ece004514af697d22e246d14c6d20f5e10136c586bca98d +size 18904101 diff --git a/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_BaseColor.1001.png b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_BaseColor.1001.png new file mode 100644 index 0000000000000000000000000000000000000000..12d49c8398bc840d32dc77d2f905cdb66ecda82a --- /dev/null +++ b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_BaseColor.1001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057fb4aea34cbf680667897bc1518cb19e01bcf3adb88ab14aec393f7e468de5 +size 1464563 diff --git a/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_BaseColor.1002.png b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_BaseColor.1002.png new file mode 100644 index 0000000000000000000000000000000000000000..0c7099459e87f17abfb3596031ac9f6914e96822 --- /dev/null +++ b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_BaseColor.1002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:511cccb02a8da3f3cdc811ed5da25f7408646936ceeb87583b787f2e3111e0eb +size 1784183 diff --git a/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_Normal.1001.png b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_Normal.1001.png new file mode 100644 index 0000000000000000000000000000000000000000..a2edec8df926c5dc2b4960b6b3e386a8be5680d2 --- /dev/null +++ b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_Normal.1001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e7426e0871169ad4f3843d624affca54a54793e37adac99db9063b0b6205e33 +size 3819083 diff --git a/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_Normal.1002.png b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_Normal.1002.png new file mode 100644 index 0000000000000000000000000000000000000000..f5ec731824063174571d496f9d5d01e503a3215c --- /dev/null +++ b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_Normal.1002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42afaf138fc26032754b7a8715a86418e98e0bb840df795dd18af0ed65681926 +size 4348366 diff --git a/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_OcclusionRoughnessMetallic.1001.png b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_OcclusionRoughnessMetallic.1001.png new file mode 100644 index 0000000000000000000000000000000000000000..701f97b60679e06a90707e4d39404a9e6ca75bdc --- /dev/null +++ b/assets/storage_rack/simready_usd/textures/M_storage_rack_v2_OcclusionRoughnessMetallic.1001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4afe7be9af772ce4fe6c79bd84838dd05cb9f109e3320a1c688c821716e16c67 +size 2522732