jandan138 commited on
Commit
5652a05
·
verified ·
1 Parent(s): d32f9b2

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. LICENSE +21 -0
  2. README.md +57 -0
  3. configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/mixed/mixed_1.yml +162 -0
  4. configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/validation.json +3 -0
  5. manifest.jsonl +91 -0
  6. runtime_dependencies.json +17 -0
  7. saved/assets/_dependencies/public_validation/08d49f866cba1541/pbr.mdl +910 -0
  8. saved/assets/_dependencies/public_validation/187c8de5cf3b71e7/OmniGlass_1.mdl +260 -0
  9. saved/assets/_dependencies/public_validation/5c86c8545a1e215e/OmniSurfacePresets.mdl +0 -0
  10. saved/assets/_dependencies/public_validation/8329bb517384e74a/color_204204204.hdr +5 -0
  11. saved/assets/_dependencies/public_validation/86946aaf125cd299/OmniPBR_Opacity.mdl +426 -0
  12. saved/assets/_dependencies/public_validation/d71555550deb30af/OmniGlass.mdl +238 -0
  13. saved/assets/_dependencies/public_validation/e0591cdda9f21eb6/OmniPBR.mdl +392 -0
  14. saved/assets/_dependencies/public_validation/materials/OmniGlass.mdl +238 -0
  15. saved/assets/_dependencies/public_validation/materials/OmniGlass_1.mdl +260 -0
  16. saved/assets/_dependencies/public_validation/materials/OmniGlass_Opacity.mdl +488 -0
  17. saved/assets/_dependencies/public_validation/materials/OmniGlass_Opacity_1.mdl +487 -0
  18. saved/assets/_dependencies/public_validation/materials/OmniPBR.mdl +392 -0
  19. saved/assets/_dependencies/public_validation/materials/OmniPBRBase.mdl +493 -0
  20. saved/assets/_dependencies/public_validation/materials/OmniPBRBase_1.mdl +461 -0
  21. saved/assets/_dependencies/public_validation/materials/OmniPBR_ClearCoat.mdl +707 -0
  22. saved/assets/_dependencies/public_validation/materials/OmniPBR_ClearCoat_Opacity.mdl +884 -0
  23. saved/assets/_dependencies/public_validation/materials/OmniPBR_Opacity.mdl +426 -0
  24. saved/assets/_dependencies/public_validation/materials/OmniSurface.mdl +1688 -0
  25. saved/assets/_dependencies/public_validation/materials/OmniSurfaceLite.mdl +1187 -0
  26. saved/assets/_dependencies/public_validation/materials/OmniSurfacePresets.mdl +0 -0
  27. saved/assets/_dependencies/public_validation/materials/pbr.mdl +910 -0
  28. saved/assets/miscs/curobo/R5a/LICENSE.curobo +77 -0
  29. saved/assets/miscs/curobo/R5a/NOTICE.md +1 -0
  30. saved/assets/miscs/curobo/R5a/R5a.urdf +511 -0
  31. saved/assets/miscs/curobo/R5a/meshes/link7.STL +0 -0
  32. saved/assets/miscs/curobo/R5a/meshes/link8.STL +0 -0
  33. saved/assets/miscs/curobo/R5a/r5a_left_arm.yml +152 -0
  34. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass.mdl +238 -0
  35. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_1.mdl +260 -0
  36. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_Opacity.mdl +488 -0
  37. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_Opacity_1.mdl +487 -0
  38. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR.mdl +392 -0
  39. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBRBase.mdl +493 -0
  40. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBRBase_1.mdl +461 -0
  41. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_ClearCoat.mdl +707 -0
  42. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_ClearCoat_Opacity.mdl +884 -0
  43. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_Opacity.mdl +426 -0
  44. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurface.mdl +1688 -0
  45. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurfaceLite.mdl +1187 -0
  46. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurfacePresets.mdl +0 -0
  47. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/pbr.mdl +910 -0
  48. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/color_204204204.hdr +5 -0
  49. saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/scene.usda +80 -0
  50. saved/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation_mixed_1/000/meta_info.pkl +3 -0
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Intern Robotics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ tags:
6
+ - robotics
7
+ - simulation
8
+ - wet-op-bench
9
+ ---
10
+
11
+ # WET-OP Bench — Validation Example
12
+
13
+ This release contains exactly **one episode** for **task 01: pouring from an Erlenmeyer flask into a graduated cylinder**. It provides the simulator scene, robot assets, task configuration and saved initial state. It contains **no recorded trajectory or LMDB database**.
14
+
15
+ This is a single initialization example, not the complete validation set and not a basis for reporting full-benchmark performance. No other validation episodes, test episodes or private holdout episodes are included.
16
+
17
+ ## Contents
18
+
19
+ - `saved/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation_mixed_1/000/meta_info.pkl`: saved task state and instruction. Recording counters are cleared; initial task data are preserved.
20
+ - `saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/`: original scene and its dependencies, with portable references.
21
+ - `saved/assets/robot_usds/lift2_scientific_experiments/`: robot assets.
22
+ - `configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/`: single-case configuration and selector.
23
+ - `runtime_dependencies.json`: simulator and material requirements.
24
+ - `manifest.jsonl`: file sizes and SHA-256 digests.
25
+
26
+ The scene background, object geometry, initial state and physics settings are preserved. `public_validation` is the publication directory name, not a newly generated background.
27
+
28
+ ## Download and load
29
+
30
+ ```python
31
+ from huggingface_hub import snapshot_download
32
+ path = snapshot_download(
33
+ repo_id="InternRobotics/WET-OP-Bench-Validation",
34
+ repo_type="dataset",
35
+ local_dir="WET-OP-Bench-Validation",
36
+ )
37
+ ```
38
+
39
+ Use an isolated GenManip-Sim checkout compatible with Isaac Sim 4.1 and the scientific-experiment Lift2 tasks. Place the downloaded `saved/assets`, `saved/tasks`, and configuration entries at their matching repository-relative locations. Select `scientific_experiments/task_01_pour_flask_to_cylinder/validation/mixed/mixed_1.yml`. The simulator and GenManip-Sim code are not included here. `meta_info.pkl` is a Python pickle intended for the trusted GenManip loader.
40
+
41
+ Isaac Sim supplies the built-in `OmniPBR.mdl` and `OmniGlass.mdl` material modules. The tabletop shader references the official NVIDIA `Plastic_Thick_Translucent.mdl` URL recorded in `runtime_dependencies.json`; network access is needed on first load. This shader is byte-identical to the original runtime material and is not bundled in this dataset.
42
+
43
+ ## Verification and limitations
44
+
45
+ The package passed isolated Isaac Sim 4.1 initialization and 20 hold steps with four camera observations. Geometry, physics and material values were compared against the original scene. Paired reset and final images preserve its appearance. This is an initialization/packaging check, not a successful pouring demonstration or policy evaluation. The original initial camera framing is retained: some views crop the flask rim or do not fully show the receiving container.
46
+
47
+ ## Related dataset
48
+
49
+ [WET-OP-Bench-Train](https://huggingface.co/datasets/InternRobotics/WET-OP-Bench-Train) contains 7,000 demonstrations across 14 task folders.
50
+
51
+ ## Provenance and license
52
+
53
+ All scene and model assets were created internally by the AI Lab team. The team's released data and assets use the MIT License in `LICENSE`. Bundled NVIDIA material software modules retain their embedded upstream license notices. The bundled `r5a_left_arm.yml` cuRobo planner configuration retains its original NVIDIA notice and `LICENSE.curobo`, which limits that software configuration to research/evaluation use. Robot-specific assets are team-authored. NVIDIA runtime software and the remotely referenced shader remain subject to their original terms; the dataset MIT license does not relicense them.
54
+
55
+ ## Release status
56
+
57
+ Upload in progress. Wait for the release status to change to verified before using a complete snapshot.
configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/mixed/mixed_1.yml ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ demonstration_configs:
2
+ - domain_randomization: &id001
3
+ cameras:
4
+ config_path: configs/cameras/fixed_camera_lift2_scientific_experiments.yml
5
+ type: fixed
6
+ random_environment:
7
+ has_wall: false
8
+ hdr: false
9
+ robot_base_position: false
10
+ robot_eepose: false
11
+ table_texture: false
12
+ table_type: false
13
+ wall_texture: false
14
+ rewrite_instruction: false
15
+ material_overrides:
16
+ - prim_path: /World/_scene/LiquidMaterial/PreviewSurface
17
+ attribute: inputs:diffuseColor
18
+ value:
19
+ - 0.24
20
+ - 0.83
21
+ - 0.68
22
+ generation_config: &id002
23
+ action_path:
24
+ mode: auto
25
+ robot: 0
26
+ articulation: []
27
+ goal:
28
+ - []
29
+ mode: manual
30
+ planner: curobo
31
+ instruction: no instruction
32
+ layout_config: &id003
33
+ ignored_objects: []
34
+ type: None
35
+ mode: manual
36
+ num_episode: 50
37
+ object_config: {}
38
+ preprocess_config: []
39
+ robots:
40
+ - &id004
41
+ type: manip/lift2/R5a
42
+ usd_path: robot_usds/lift2_scientific_experiments/robot.usd
43
+ position:
44
+ - 0.0
45
+ - -0.7
46
+ - 0.0
47
+ orientation:
48
+ - 0.7071067812
49
+ - 0.0
50
+ - 0.0
51
+ - 0.7071067812
52
+ table_uid: table
53
+ physics_scene_config:
54
+ BounceThreshold: 0.0
55
+ BroadphaseType: GPU
56
+ CollisionSystem: PCM
57
+ EnableCCD: false
58
+ EnableEnhancedDeterminism: false
59
+ EnableExternalForcesEveryIteration: false
60
+ EnableGPUDynamics: true
61
+ EnableResidualReporting: false
62
+ EnableSceneQuerySupport: true
63
+ EnableStabilization: true
64
+ FrictionCorrelationDistance: 0.02500000037252903
65
+ FrictionOffsetThreshold: 0.03999999910593033
66
+ FrictionType: patch
67
+ GpuCollisionStackSize: 67108864
68
+ GpuFoundLostAggregatePairsCapacity: 10485760
69
+ GpuFoundLostPairsCapacity: 262144
70
+ GpuHeapCapacity: 67108864
71
+ GpuMaxDeformableSurfaceContacts: 1048576
72
+ GpuMaxHairContacts: 1048576
73
+ GpuMaxNumPartitions: 8
74
+ GpuMaxParticleContacts: 1048576
75
+ GpuMaxRigidContactCount: 524288
76
+ GpuMaxRigidPatchCount: 81920
77
+ GpuMaxSoftBodyContacts: 1048576
78
+ GpuTempBufferCapacity: 16777216
79
+ GpuTotalAggregatePairsCapacity: 1024
80
+ InvertCollisionGroupFilter: false
81
+ MaxBiasCoefficient: Inf
82
+ MaxPositionIterationCount: 255
83
+ MaxVelocityIterationCount: 255
84
+ MinPositionIterationCount: 1
85
+ MinVelocityIterationCount: 0
86
+ ReportKinematicKinematicPairs: false
87
+ ReportKinematicStaticPairs: false
88
+ SolverType: TGS
89
+ TimeStepsPerSecond: 120
90
+ UpdateType: Synchronous
91
+ task_name: scientific_experiments/task_01_pour_flask_to_cylinder/validation_mixed_1
92
+ usd_name: scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/scene
93
+ env_vars:
94
+ MDL_SYSTEM_PATH: /isaac-sim/materials/:{ASSETS_DIR}/miscs/mdl/ebench/mdl
95
+ evaluation_configs:
96
+ - domain_randomization: *id001
97
+ generation_config: *id002
98
+ instruction: no instruction
99
+ layout_config: *id003
100
+ mode: manual
101
+ num_test: 1
102
+ num_steps: 3500
103
+ preserve_score_on_invalid_state: true
104
+ warmup_steps: 300
105
+ physics_dt: 0.0083333333
106
+ rendering_dt: 0.0083333333
107
+ object_config: {}
108
+ physics_scene_config:
109
+ BounceThreshold: 0.0
110
+ BroadphaseType: GPU
111
+ CollisionSystem: PCM
112
+ EnableCCD: false
113
+ EnableEnhancedDeterminism: false
114
+ EnableExternalForcesEveryIteration: false
115
+ EnableGPUDynamics: true
116
+ EnableResidualReporting: false
117
+ EnableSceneQuerySupport: true
118
+ EnableStabilization: true
119
+ FrictionCorrelationDistance: 0.02500000037252903
120
+ FrictionOffsetThreshold: 0.03999999910593033
121
+ FrictionType: patch
122
+ GpuCollisionStackSize: 67108864
123
+ GpuFoundLostAggregatePairsCapacity: 10485760
124
+ GpuFoundLostPairsCapacity: 262144
125
+ GpuHeapCapacity: 67108864
126
+ GpuMaxDeformableSurfaceContacts: 1048576
127
+ GpuMaxHairContacts: 1048576
128
+ GpuMaxNumPartitions: 8
129
+ GpuMaxParticleContacts: 1048576
130
+ GpuMaxRigidContactCount: 524288
131
+ GpuMaxRigidPatchCount: 81920
132
+ GpuMaxSoftBodyContacts: 1048576
133
+ GpuTempBufferCapacity: 16777216
134
+ GpuTotalAggregatePairsCapacity: 1024
135
+ InvertCollisionGroupFilter: false
136
+ MaxBiasCoefficient: Inf
137
+ MaxPositionIterationCount: 255
138
+ MaxVelocityIterationCount: 255
139
+ MinPositionIterationCount: 1
140
+ MinVelocityIterationCount: 0
141
+ ReportKinematicKinematicPairs: false
142
+ ReportKinematicStaticPairs: false
143
+ SolverType: TGS
144
+ TimeStepsPerSecond: 120
145
+ UpdateType: Synchronous
146
+ preprocess_config:
147
+ - config:
148
+ Restitution: 0.0
149
+ DynamicFriction: 5
150
+ StaticFriction: 5
151
+ FrictionCombineMode: max
152
+ RestitutionCombineMode: multiply
153
+ ImprovePatchFriction: true
154
+ robot_type: lift2
155
+ type: set_robot_physics_material
156
+ robots:
157
+ - *id004
158
+ table_uid: table
159
+ task_name: scientific_experiments/task_01_pour_flask_to_cylinder/validation_mixed_1
160
+ usd_name: scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/scene
161
+ env_vars:
162
+ MDL_SYSTEM_PATH: /isaac-sim/materials/:{ASSETS_DIR}/miscs/mdl/ebench/mdl
configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/validation.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [
2
+ "scientific_experiments/task_01_pour_flask_to_cylinder/validation/mixed/mixed_1.yml"
3
+ ]
manifest.jsonl ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"path": "LICENSE", "size": 1072, "sha256": "1c97c9d2c7e2cb2c40aa48d9438e38eade519d064db038e7ae47df5a29ef1605"}
2
+ {"path": "configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/mixed/mixed_1.yml", "size": 4893, "sha256": "e7cbf0c5b008ce017843582c714120574339a785d7af8c3676cafe62eb4686a3"}
3
+ {"path": "configs/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation/validation.json", "size": 91, "sha256": "c259cb17dfa5c8ea7661708bed5956250670d970ff6ae0de83edb7fc31560dc5"}
4
+ {"path": "runtime_dependencies.json", "size": 588, "sha256": "e82cd29b0b24fa40e5544a95c85b18f63bdb70f83c928d7af137b87ca7ff8d20"}
5
+ {"path": "saved/assets/_dependencies/public_validation/08d49f866cba1541/pbr.mdl", "size": 37481, "sha256": "08d49f866cba15416a9614776ce3502dd922c3ca5441261496df84ffee1ae0a2"}
6
+ {"path": "saved/assets/_dependencies/public_validation/0d1ddd81221ec704/grain_albedo_1.png", "size": 782568, "sha256": "0d1ddd81221ec704a6c71760b0f110f97c3508d5971aa2bdbb7acf200692153e"}
7
+ {"path": "saved/assets/_dependencies/public_validation/187c8de5cf3b71e7/OmniGlass_1.mdl", "size": 9930, "sha256": "187c8de5cf3b71e7b89dfc5b70549aaa7535336442e08a1e3ad38046f03127d9"}
8
+ {"path": "saved/assets/_dependencies/public_validation/5c86c8545a1e215e/OmniSurfacePresets.mdl", "size": 275796, "sha256": "5c86c8545a1e215ec4b99e60eb66f9112ca5952cc66ca13ec0c26687dcfcb930"}
9
+ {"path": "saved/assets/_dependencies/public_validation/6f6de01bc1f93b77/albedo_nobrand.png", "size": 6055509, "sha256": "6f6de01bc1f93b77321e7044b6c7259a1159670953fa79c1b14ab75276c39fd1"}
10
+ {"path": "saved/assets/_dependencies/public_validation/8329bb517384e74a/color_204204204.hdr", "size": 109, "sha256": "8329bb517384e74aef8e783fb1e15d1cd2b42a12c2e192d1e3b25071ea361f19"}
11
+ {"path": "saved/assets/_dependencies/public_validation/86946aaf125cd299/OmniPBR_Opacity.mdl", "size": 14393, "sha256": "86946aaf125cd2993b6ae18f35ae8facb44bf15f528511a6f7ae74225e79e099"}
12
+ {"path": "saved/assets/_dependencies/public_validation/8d73e37c410fc0dd/grain_normal.png", "size": 1391819, "sha256": "8d73e37c410fc0dde64ff5b4e183414890f9b4f4a1166e2db4d3edb5e1f22b6d"}
13
+ {"path": "saved/assets/_dependencies/public_validation/9eb0f6ef31cbf5a7/grain_albedo.png", "size": 758417, "sha256": "9eb0f6ef31cbf5a7c73bdb7d9129d5bbd52cd1bd5f562ac666ae7b35827f3aa9"}
14
+ {"path": "saved/assets/_dependencies/public_validation/a523ac3c950b1d74/wall.png", "size": 502471, "sha256": "a523ac3c950b1d746e6a6a92f422a3620f0a23e894bd400f3a4f78066ee38f23"}
15
+ {"path": "saved/assets/_dependencies/public_validation/a961a7fb56b25ad1/lounge_booth_table_texture2.png", "size": 2239612, "sha256": "a961a7fb56b25ad1905310f6be55efcb167f241fe2f01836468bc17f7a6602ba"}
16
+ {"path": "saved/assets/_dependencies/public_validation/b5714c178a88aac6/floor.png", "size": 655209, "sha256": "b5714c178a88aac635295fdf7ea6d555f35a2967dcce61d2ac81a7d59a910b0e"}
17
+ {"path": "saved/assets/_dependencies/public_validation/c164035c6dd340cf/Image_1_1.png", "size": 2656133, "sha256": "c164035c6dd340cfc214847cbf33a8d4b161dcb03db443e9afa701460a954e28"}
18
+ {"path": "saved/assets/_dependencies/public_validation/c47bd6935ec13f5d/grain_normal_1.png", "size": 1392545, "sha256": "c47bd6935ec13f5d994c647452774a6ad2d699a8305600178a3eda0e1a22feb2"}
19
+ {"path": "saved/assets/_dependencies/public_validation/c993bac14939eb27/lounge_booth_table_texture1.jpg", "size": 221975, "sha256": "c993bac14939eb27ab4cf248fee5816a6873885d8a159e0e97c2f4fad0619925"}
20
+ {"path": "saved/assets/_dependencies/public_validation/d71555550deb30af/OmniGlass.mdl", "size": 8746, "sha256": "d71555550deb30af245c0ec939c8647442df5709a2977549cad7f6ddcc8c1182"}
21
+ {"path": "saved/assets/_dependencies/public_validation/e048e2df07d0d95b/Image_0_1.png", "size": 2327418, "sha256": "e048e2df07d0d95b768d87d846fbf1d0be4f1a8fbc4df8c2ac6643cedc6f1c5b"}
22
+ {"path": "saved/assets/_dependencies/public_validation/e0591cdda9f21eb6/OmniPBR.mdl", "size": 14447, "sha256": "e0591cdda9f21eb61360a39919a82bbff8b8a872344d89c67e6b245dae974c3b"}
23
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniGlass.mdl", "size": 8746, "sha256": "d71555550deb30af245c0ec939c8647442df5709a2977549cad7f6ddcc8c1182"}
24
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniGlass_1.mdl", "size": 9930, "sha256": "187c8de5cf3b71e7b89dfc5b70549aaa7535336442e08a1e3ad38046f03127d9"}
25
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniGlass_Opacity.mdl", "size": 16193, "sha256": "c7083b339c08371c9d8b9acda49e61fec294d380a6ce2b81fa9419583c0ef86d"}
26
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniGlass_Opacity_1.mdl", "size": 17219, "sha256": "87facd037b11888d3052b663bb20e41367b769095bde4c9cf686925fa17eb2a4"}
27
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniPBR.mdl", "size": 14447, "sha256": "e0591cdda9f21eb61360a39919a82bbff8b8a872344d89c67e6b245dae974c3b"}
28
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniPBRBase.mdl", "size": 18876, "sha256": "edcc669a238798a4d90ce36bd535282d23f88cddc544d68a532a5b732432788e"}
29
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniPBRBase_1.mdl", "size": 17696, "sha256": "ba0f6f5e32129f5bcdf4cf54c549bd44931d71636eef01fc522415172afcdd00"}
30
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniPBR_ClearCoat.mdl", "size": 27986, "sha256": "f9b1d254cfa0c45742de1e0532bd574bb766f69ffe1b66a9b80a816a00e3f329"}
31
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniPBR_ClearCoat_Opacity.mdl", "size": 31045, "sha256": "522933702bec44702db155046d5eb0b74f69c1286deff9770afb2dcd7f87c16f"}
32
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniPBR_Opacity.mdl", "size": 14393, "sha256": "86946aaf125cd2993b6ae18f35ae8facb44bf15f528511a6f7ae74225e79e099"}
33
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniSurface.mdl", "size": 62903, "sha256": "6477aaf2f837524e2b4aa52bc86dd4a8b20f17bf5f151fc718098d4a1a59a88c"}
34
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniSurfaceLite.mdl", "size": 43765, "sha256": "58384eeaf4d320dca4babcaabe5457ce84ca1bbc59c09ec9a5a7feab56314df8"}
35
+ {"path": "saved/assets/_dependencies/public_validation/materials/OmniSurfacePresets.mdl", "size": 275796, "sha256": "5c86c8545a1e215ec4b99e60eb66f9112ca5952cc66ca13ec0c26687dcfcb930"}
36
+ {"path": "saved/assets/_dependencies/public_validation/materials/pbr.mdl", "size": 37481, "sha256": "08d49f866cba15416a9614776ce3502dd922c3ca5441261496df84ffee1ae0a2"}
37
+ {"path": "saved/assets/miscs/curobo/R5a/LICENSE.curobo", "size": 4396, "sha256": "797d1e69fe7fd1c502e87af12c5a0ed08a84c7a8a22af1c7a3589cbfadff4364"}
38
+ {"path": "saved/assets/miscs/curobo/R5a/NOTICE.md", "size": 291, "sha256": "18277ec524713218857b2549bb46f56a57a29217ee2cf5887be99a3f558895e9"}
39
+ {"path": "saved/assets/miscs/curobo/R5a/R5a/R5a.usd", "size": 4200204, "sha256": "9cbc622fc8d736a661f8d692ea77d4e47d17ed5fa00ff47726c0bc7147a7bac6"}
40
+ {"path": "saved/assets/miscs/curobo/R5a/R5a.urdf", "size": 10658, "sha256": "9ddd012fd83e18aede7ce28a001a30ada8eaf851418a8a63f15b48eca1bfa496"}
41
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/base_link.STL", "size": 298284, "sha256": "1ea7ba47065195c7cc12d5372977fea91e96972d806542f90450462e13019306"}
42
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link1.STL", "size": 155484, "sha256": "65659b3f97f89c22f674bd38567b599ba2e35f7b305085145a232f642aa179cb"}
43
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link2.STL", "size": 713184, "sha256": "c7d693a9c74fba586c6941aa2754116bf1cb1eeb51bea4c31dda7a79d2bd88a9"}
44
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link3.STL", "size": 781184, "sha256": "3c5c590f64cc944dd4f843d52b86c393d2a6a222be25f68a063835a04dfd9562"}
45
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link4.STL", "size": 142884, "sha256": "da6e53e00ffbf5c3b3ab5bbdb980a74f580bb76298b63bdebf72a0b0505d6ced"}
46
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link5.STL", "size": 732184, "sha256": "03a789782b7527bd075d99cc0828d5b0e7d4351ffdb574d28f20681d265a24f7"}
47
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link6.STL", "size": 643784, "sha256": "6e33442021162b8e2d035cd6a1700184280118a10e85519264d402bcb94bac12"}
48
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link7.STL", "size": 98984, "sha256": "cf13153c5a4058980a472983b80ce73fb0cb7c10a0ff9b7107b88c72b6e6766f"}
49
+ {"path": "saved/assets/miscs/curobo/R5a/meshes/link8.STL", "size": 98984, "sha256": "19d1dcc773a32f003d9b9d8794f7f821661b5488f35198028db5d1885ca7cc8b"}
50
+ {"path": "saved/assets/miscs/curobo/R5a/r5a_left_arm.yml", "size": 4816, "sha256": "515724a27614a85e2c04337716cd0c76950d462598573115d8ffa58e5dc44e9d"}
51
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/.gitignore", "size": 1, "sha256": "684888c0ebb17f374298b65ee2807526c066094c701bcc7ebbe1c1095f494fc1"}
52
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/.collect.mapping.json.lock", "size": 0, "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
53
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/.collect.mapping.json.metadata", "size": 100, "sha256": "5617052e11c0954787270401d71c05903f5277b0a3bf06ebe2a65922e0f1c727"}
54
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/.gitattributes.lock", "size": 0, "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
55
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/.gitattributes.metadata", "size": 101, "sha256": "504476e02229c5812196db8d01c467d544640019fed910cdf04248601e72c8fa"}
56
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/SubUSDs/visuals_bkk.usd.lock", "size": 0, "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
57
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/SubUSDs/visuals_bkk.usd.metadata", "size": 125, "sha256": "c6e927a5c2c846f31a6efe3437062072f6f0d86f72eddd8fce626f8ac3248bec"}
58
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/robot.usd.lock", "size": 0, "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
59
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.cache/huggingface/download/robot.usd.metadata", "size": 125, "sha256": "dc9e05e4c1f969272f77472979b15000523dd02e5c096721967981780a76feb9"}
60
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/.thumbs/256x256/robot.usd.png", "size": 47735, "sha256": "0cd0e43b22a55ea812b6ead619d2bd07715641e1f8e187bf0020b0ac6e90c6d8"}
61
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/SubUSDs/visuals_bkk.usd", "size": 107972, "sha256": "2f2313da165e49bb536b2d5d40591d321a92223aa78e15d4004a9ab6bf006eb9"}
62
+ {"path": "saved/assets/robot_usds/lift2_scientific_experiments/robot.usd", "size": 16069557, "sha256": "4e8c408ddcc44489a0a81fe271d8e2a10352c875803a9327dcc5065f14267657"}
63
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass.mdl", "size": 8746, "sha256": "d71555550deb30af245c0ec939c8647442df5709a2977549cad7f6ddcc8c1182"}
64
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_1.mdl", "size": 9930, "sha256": "187c8de5cf3b71e7b89dfc5b70549aaa7535336442e08a1e3ad38046f03127d9"}
65
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_Opacity.mdl", "size": 16193, "sha256": "c7083b339c08371c9d8b9acda49e61fec294d380a6ce2b81fa9419583c0ef86d"}
66
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_Opacity_1.mdl", "size": 17219, "sha256": "87facd037b11888d3052b663bb20e41367b769095bde4c9cf686925fa17eb2a4"}
67
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR.mdl", "size": 14447, "sha256": "e0591cdda9f21eb61360a39919a82bbff8b8a872344d89c67e6b245dae974c3b"}
68
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBRBase.mdl", "size": 18876, "sha256": "edcc669a238798a4d90ce36bd535282d23f88cddc544d68a532a5b732432788e"}
69
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBRBase_1.mdl", "size": 17696, "sha256": "ba0f6f5e32129f5bcdf4cf54c549bd44931d71636eef01fc522415172afcdd00"}
70
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_ClearCoat.mdl", "size": 27986, "sha256": "f9b1d254cfa0c45742de1e0532bd574bb766f69ffe1b66a9b80a816a00e3f329"}
71
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_ClearCoat_Opacity.mdl", "size": 31045, "sha256": "522933702bec44702db155046d5eb0b74f69c1286deff9770afb2dcd7f87c16f"}
72
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_Opacity.mdl", "size": 14393, "sha256": "86946aaf125cd2993b6ae18f35ae8facb44bf15f528511a6f7ae74225e79e099"}
73
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurface.mdl", "size": 62903, "sha256": "6477aaf2f837524e2b4aa52bc86dd4a8b20f17bf5f151fc718098d4a1a59a88c"}
74
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurfaceLite.mdl", "size": 43765, "sha256": "58384eeaf4d320dca4babcaabe5457ce84ca1bbc59c09ec9a5a7feab56314df8"}
75
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurfacePresets.mdl", "size": 275796, "sha256": "5c86c8545a1e215ec4b99e60eb66f9112ca5952cc66ca13ec0c26687dcfcb930"}
76
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/pbr.mdl", "size": 37481, "sha256": "08d49f866cba15416a9614776ce3502dd922c3ca5441261496df84ffee1ae0a2"}
77
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/Image_0_1.png", "size": 2327418, "sha256": "e048e2df07d0d95b768d87d846fbf1d0be4f1a8fbc4df8c2ac6643cedc6f1c5b"}
78
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/Image_1_1.png", "size": 2656133, "sha256": "c164035c6dd340cfc214847cbf33a8d4b161dcb03db443e9afa701460a954e28"}
79
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/albedo_nobrand.png", "size": 6055509, "sha256": "6f6de01bc1f93b77321e7044b6c7259a1159670953fa79c1b14ab75276c39fd1"}
80
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/color_204204204.hdr", "size": 109, "sha256": "8329bb517384e74aef8e783fb1e15d1cd2b42a12c2e192d1e3b25071ea361f19"}
81
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/floor.png", "size": 655209, "sha256": "b5714c178a88aac635295fdf7ea6d555f35a2967dcce61d2ac81a7d59a910b0e"}
82
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/grain_albedo.png", "size": 758417, "sha256": "9eb0f6ef31cbf5a7c73bdb7d9129d5bbd52cd1bd5f562ac666ae7b35827f3aa9"}
83
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/grain_albedo_1.png", "size": 782568, "sha256": "0d1ddd81221ec704a6c71760b0f110f97c3508d5971aa2bdbb7acf200692153e"}
84
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/grain_normal.png", "size": 1391819, "sha256": "8d73e37c410fc0dde64ff5b4e183414890f9b4f4a1166e2db4d3edb5e1f22b6d"}
85
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/grain_normal_1.png", "size": 1392545, "sha256": "c47bd6935ec13f5d994c647452774a6ad2d699a8305600178a3eda0e1a22feb2"}
86
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/lounge_booth_table_texture1.jpg", "size": 221975, "sha256": "c993bac14939eb27ab4cf248fee5816a6873885d8a159e0e97c2f4fad0619925"}
87
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/lounge_booth_table_texture2.png", "size": 2239612, "sha256": "a961a7fb56b25ad1905310f6be55efcb167f241fe2f01836468bc17f7a6602ba"}
88
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/wall.png", "size": 502471, "sha256": "a523ac3c950b1d746e6a6a92f422a3620f0a23e894bd400f3a4f78066ee38f23"}
89
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/scene.usd", "size": 18360430, "sha256": "f4957fd963781936035b94c81539b61cb6ea95b9c21d8d8e916f71cfadf01f7b"}
90
+ {"path": "saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/scene.usda", "size": 3203, "sha256": "b27be191877415fa90923ff72ba5147f0818226c43464dd1c0da5ee63bf19715"}
91
+ {"path": "saved/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation_mixed_1/000/meta_info.pkl", "size": 21801, "sha256": "2c1b076bf353abd13022f1f31dd398b77c09f8abae13e369e8852df9857a45f9"}
runtime_dependencies.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "isaac_sim": "4.1",
3
+ "material": {
4
+ "url": "https://omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/vMaterials_2/Plastic/Plastic_Thick_Translucent.mdl",
5
+ "sha256": "e6fc7403fce0da94912d3aa2ced0638a2aafb4c9cd504a745743f4273b7dc333",
6
+ "redistributed": false
7
+ },
8
+ "builtin_mdl": [
9
+ "OmniPBR.mdl",
10
+ "OmniGlass.mdl"
11
+ ],
12
+ "planner_configuration": {
13
+ "path": "saved/assets/miscs/curobo/R5a/r5a_left_arm.yml",
14
+ "license": "saved/assets/miscs/curobo/R5a/LICENSE.curobo",
15
+ "scope": "cuRobo template/configuration; research or evaluation use"
16
+ }
17
+ }
saved/assets/_dependencies/public_validation/08d49f866cba1541/pbr.mdl ADDED
@@ -0,0 +1,910 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ *****************************************************************************/
28
+
29
+ mdl 1.8;
30
+
31
+ import ::anno::*;
32
+ import ::base::*;
33
+ import ::df::*;
34
+ import ::math::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::scene::*;
38
+ import ::limits::*;
39
+
40
+ export enum gltf_alpha_mode {
41
+ opaque,
42
+ mask,
43
+ blend
44
+ };
45
+
46
+ export enum gltf_wrapping_mode {
47
+ clamp_to_edge = 33071,
48
+ mirrored_repeat = 33648,
49
+ repeat = 10497
50
+ };
51
+
52
+ export struct gltf_texture_lookup_value
53
+ {
54
+ bool valid = false;
55
+ float4 value = float4(0.0, 0.0, 0.0, 1.0);
56
+ };
57
+
58
+ export struct gltf_normal_texture_lookup_value
59
+ {
60
+ bool valid = false;
61
+ float3 value = float3(0.0);
62
+ };
63
+
64
+ float compute_opacity(gltf_alpha_mode mode, float alpha, float cutoff) {
65
+ switch (mode) {
66
+ case mask:
67
+ return alpha < cutoff ? 0.0 : 1.0;
68
+ case blend:
69
+ return alpha;
70
+ case opaque:
71
+ return 1.0;
72
+ }
73
+ }
74
+
75
+ float4 gltf_prepare_tex_float4(gltf_texture_lookup_value sample) {
76
+ return sample.valid ? sample.value : float4(1.0);
77
+ }
78
+
79
+ float3 gltf_prepare_tex_float3(gltf_texture_lookup_value sample) {
80
+ return sample.valid ? float3(sample.value.x, sample.value.y, sample.value.z) : float3(1.0);
81
+ }
82
+
83
+ float3 gltf_prepare_normal(gltf_normal_texture_lookup_value sample) {
84
+ return sample.valid ? sample.value : state::normal();
85
+ }
86
+
87
+ float gltf_prepare_occlusion(gltf_texture_lookup_value sample, float occlusion_strength) {
88
+ float occulusion = sample.valid ? sample.value.x : 1.0;
89
+ return math::lerp(1.0, occulusion, occlusion_strength);
90
+ }
91
+
92
+ color gltf_perpare_emission(gltf_texture_lookup_value sample, color emissive_factor) {
93
+ return emissive_factor * color(gltf_prepare_tex_float3(sample));
94
+ }
95
+
96
+ ::tex::wrap_mode convert_wrap_mode(gltf_wrapping_mode mode)
97
+ {
98
+ if (mode == clamp_to_edge)
99
+ return ::tex::wrap_clamp;
100
+ if (mode == mirrored_repeat)
101
+ return ::tex::wrap_mirrored_repeat;
102
+
103
+ return ::tex::wrap_repeat;
104
+ }
105
+
106
+ float2 khr_texture_transform_apply(
107
+ float2 coord,
108
+ float2 offset,
109
+ float rotation,
110
+ float2 scale
111
+ )
112
+ {
113
+ // MDL expects the texture coordinate origin at the bottom left (gltf at top left)
114
+ // Assuming the renderer follows the MDL specification in which case the coordinates
115
+ // have been flipped either while loading the glTF geometry or while setting up the state.
116
+
117
+ // Undo the flipping for the transformation to get into the original glTF texture space.
118
+ coord = float2(coord.x, 1.0f - coord.y);
119
+
120
+ // first scale
121
+ coord = coord * scale;
122
+ // then rotate
123
+ float cos_rotation = ::math::cos(rotation);
124
+ float sin_rotation = ::math::sin(rotation);
125
+ coord = float2(cos_rotation * coord.x + sin_rotation * coord.y, cos_rotation * coord.y - sin_rotation * coord.x);
126
+ // then translate
127
+ coord = coord + offset;
128
+
129
+ // flip back
130
+ coord = float2(coord.x, 1.0f - coord.y);
131
+ return coord;
132
+ }
133
+
134
+ export gltf_texture_lookup_value gltf_texture_lookup(
135
+ uniform texture_2d texture = texture_2d()
136
+ [[
137
+ anno::in_group("Source"),
138
+ anno::display_name("Texture"),
139
+ anno::description("Texture File")
140
+ ]],
141
+ uniform int tex_coord_index = 0
142
+ [[
143
+ anno::in_group("Source"),
144
+ anno::display_name("Coordinate Set"),
145
+ anno::description("Texture coordinate set (UV-Set). KHR_texture_transform overrides the textureInfo texCoord value if supplied."),
146
+ anno::enable_if("::tex::texture_isvalid(texture)")
147
+ ]],
148
+
149
+ uniform float2 offset = float2(0.0f, 0.0)
150
+ [[
151
+ anno::in_group("Texture Transform"),
152
+ anno::display_name("Offset"),
153
+ anno::description("The offset of the UV coordinate origin as a factor of the texture dimensions."),
154
+ anno::enable_if("::tex::texture_isvalid(texture)")
155
+ ]],
156
+ uniform float rotation = 0.0
157
+ [[
158
+ anno::hard_range(0.0, 2.0 * ::math::PI),
159
+ anno::in_group("Texture Transform"),
160
+ anno::display_name("Rotation"),
161
+ anno::description("Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise."),
162
+ anno::enable_if("::tex::texture_isvalid(texture)")
163
+ ]],
164
+ uniform float2 scale = float2(1.0f, 1.0f)
165
+ [[
166
+ anno::in_group("Texture Transform"),
167
+ anno::display_name("Scale"),
168
+ anno::description("The scale factor applied to the components of the UV coordinates."),
169
+ anno::enable_if("::tex::texture_isvalid(texture)")
170
+ ]],
171
+
172
+ uniform gltf_wrapping_mode wrap_s = repeat
173
+ [[
174
+ anno::in_group("Sampler"),
175
+ anno::display_name("Wrap S"),
176
+ anno::description("S (U) wrapping mode."),
177
+ anno::enable_if("::tex::texture_isvalid(texture)")
178
+ ]],
179
+ uniform gltf_wrapping_mode wrap_t = repeat
180
+ [[
181
+ anno::in_group("Sampler"),
182
+ anno::display_name("Wrap T"),
183
+ anno::description("T (V) wrapping mode."),
184
+ anno::enable_if("::tex::texture_isvalid(texture)")
185
+ ]]
186
+ )
187
+ [[
188
+ anno::author("NVIDIA Corporation"),
189
+ anno::display_name("GLTF Texture Lookup"),
190
+ anno::description("Function to read a color or color with alpha channel texture.")
191
+ ]]
192
+ {
193
+ gltf_texture_lookup_value tex_ret;
194
+ if (!tex::texture_isvalid(texture))
195
+ return tex_ret;
196
+
197
+ float3 tex_coord3 = state::texture_coordinate(tex_coord_index);
198
+ float2 tex_coord = khr_texture_transform_apply(
199
+ coord: float2(tex_coord3.x, tex_coord3.y),
200
+ offset: offset,
201
+ rotation: rotation,
202
+ scale: scale);
203
+
204
+ tex_ret.value = tex::lookup_float4(
205
+ tex: texture,
206
+ coord: tex_coord,
207
+ wrap_u: convert_wrap_mode(wrap_s),
208
+ wrap_v: convert_wrap_mode(wrap_t));
209
+ tex_ret.valid = true;
210
+ return tex_ret;
211
+ }
212
+
213
+ export gltf_normal_texture_lookup_value gltf_normal_texture_lookup(
214
+ uniform texture_2d texture = texture_2d()
215
+ [[
216
+ anno::in_group("Source"),
217
+ anno::display_name("Texture"),
218
+ anno::description("Texture File")
219
+ ]],
220
+ uniform float normal_scale_factor = 1.0
221
+ [[
222
+ anno::hard_range(0.0, 1.0),
223
+ anno::in_group("Source"),
224
+ anno::display_name("Normal Scale Factor"),
225
+ anno::description("Strength of the base layer normal mapping."),
226
+ anno::enable_if("::tex::texture_isvalid(texture)")
227
+ ]],
228
+ uniform int tex_coord_index = 0
229
+ [[
230
+ anno::in_group("Source"),
231
+ anno::display_name("Coordinate Set"),
232
+ anno::description("Texture coordinate set (UV-Set). KHR_texture_transform overrides the textureInfo texCoord value if supplied."),
233
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
234
+ ]],
235
+ uniform int tex_tangent_index = 0
236
+ [[
237
+ anno::hidden(),
238
+ anno::in_group("Source"),
239
+ anno::display_name("Coordinate Set"),
240
+ anno::description("Tangent to be to construct the tangent frame."),
241
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
242
+ ]],
243
+
244
+ uniform float2 offset = float2(0.0f, 0.0)
245
+ [[
246
+ anno::in_group("Texture Transform"),
247
+ anno::display_name("Offset"),
248
+ anno::description("The offset of the UV coordinate origin as a factor of the texture dimensions."),
249
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
250
+ ]],
251
+ uniform float rotation = 0.0
252
+ [[
253
+ anno::hard_range(0.0, 2.0 * ::math::PI),
254
+ anno::in_group("Texture Transform"),
255
+ anno::display_name("Rotation"),
256
+ anno::description("Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise."),
257
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
258
+ ]],
259
+ uniform float2 scale = float2(1.0f, 1.0f)
260
+ [[
261
+ anno::in_group("Texture Transform"),
262
+ anno::display_name("Scale"),
263
+ anno::description("The scale factor applied to the components of the UV coordinates."),
264
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
265
+ ]],
266
+
267
+ uniform gltf_wrapping_mode wrap_s = repeat
268
+ [[
269
+ anno::in_group("Sampler"),
270
+ anno::display_name("Wrap S"),
271
+ anno::description("S (U) wrapping mode."),
272
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
273
+ ]],
274
+ uniform gltf_wrapping_mode wrap_t = repeat
275
+ [[
276
+ anno::in_group("Sampler"),
277
+ anno::display_name("Wrap T"),
278
+ anno::description("T (V) wrapping mode."),
279
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
280
+ ]]
281
+ )
282
+ [[
283
+ anno::author("NVIDIA Corporation"),
284
+ anno::display_name("GLTF Normal Texture Lookup"),
285
+ anno::description("Function to read a normal texture.")
286
+ ]]
287
+ {
288
+ gltf_normal_texture_lookup_value tex_ret;
289
+ if (!::tex::texture_isvalid(texture))
290
+ return tex_ret;
291
+
292
+ float3 tex_coord3 = state::texture_coordinate(tex_coord_index);
293
+ float2 tex_coord = khr_texture_transform_apply(
294
+ coord: float2(tex_coord3.x, tex_coord3.y),
295
+ offset: offset,
296
+ rotation: rotation,
297
+ scale: scale);
298
+
299
+ tex_ret.value = base::tangent_space_normal_texture(
300
+ texture: texture,
301
+ factor: normal_scale_factor,
302
+ uvw: base::texture_coordinate_info(
303
+ position: float3(tex_coord.x, tex_coord.y, tex_coord3.z),
304
+ tangent_u: state::texture_tangent_u(tex_tangent_index),
305
+ tangent_v: state::texture_tangent_v(tex_tangent_index)),
306
+ wrap_u: convert_wrap_mode(wrap_s),
307
+ wrap_v: convert_wrap_mode(wrap_t));
308
+ tex_ret.valid = true;
309
+ return tex_ret;
310
+ }
311
+
312
+ export material gltf_material(
313
+ // base color
314
+ uniform color base_color_factor = color(1.0)
315
+ [[
316
+ anno::in_group("Metallic Roughness"),
317
+ anno::display_name("Base Color Factor"),
318
+ anno::description("The base color of the material. Multiplied to the 'Base Color Texture' if available.")
319
+ ]],
320
+
321
+ gltf_texture_lookup_value base_color_texture = gltf_texture_lookup()
322
+ [[
323
+ anno::in_group("Metallic Roughness"),
324
+ anno::display_name("Base Color Texture"),
325
+ anno::description("The base color of the material. Influenced by the 'Base Color Factor'.")
326
+ ]],
327
+
328
+ // KHR_materials_specular
329
+ uniform float specular_factor = 1.0
330
+ [[
331
+ anno::hard_range(0.0, 1.0),
332
+ anno::in_group("Specular"),
333
+ anno::display_name("Specular Factor"),
334
+ anno::description("The strength of the specular reflection. Multiplied to the 'Specular Texture' if available.")
335
+ ]],
336
+ gltf_texture_lookup_value specular_texture = gltf_texture_lookup()
337
+ [[
338
+ anno::in_group("Specular"),
339
+ anno::display_name("Specular Texture"),
340
+ anno::description("A texture that defines the strength of the specular reflection, stored in the alpha (A) channel. This will be multiplied by the 'Specular Factor'.")
341
+ ]],
342
+ uniform color specular_color_factor = color(1.0)
343
+ [[
344
+ anno::in_group("Specular"),
345
+ anno::display_name("Specular Color Factor"),
346
+ anno::description("The F0 color of the specular reflection (linear RGB). Multiplied to the 'Specular Color Texture' if available.")
347
+ ]],
348
+ gltf_texture_lookup_value specular_color_texture = gltf_texture_lookup()
349
+ [[
350
+ anno::in_group("Specular"),
351
+ anno::display_name("Specular Color Texture"),
352
+ anno::description("A texture that defines the F0 color of the specular reflection, stored in the RGB channels and encoded in sRGB. This texture will be multiplied by 'Specular Color Factor'.")
353
+ ]],
354
+
355
+ // metallic roughness
356
+ uniform float metallic_factor = 1.0
357
+ [[
358
+ anno::hard_range(0.0, 1.0),
359
+ anno::in_group("Metallic Roughness"),
360
+ anno::display_name("Metallic Factor"),
361
+ anno::description("The metalness of the material. Select between dielectric (0.0) and metallic (1.0). Multiplied to the 'Metal/Rough Texture' value if available.")
362
+ ]],
363
+
364
+ uniform float roughness_factor = 1.0
365
+ [[
366
+ anno::hard_range(0.0, 1.0),
367
+ anno::in_group("Metallic Roughness"),
368
+ anno::display_name("Roughness Factor"),
369
+ anno::description("The roughness of the material. Select between very glossy (0.0) and dull (1.0). Multiplied to the 'Metal/Rough Texture' value if available.")
370
+ ]],
371
+ gltf_texture_lookup_value metallic_roughness_texture = gltf_texture_lookup()
372
+ [[
373
+ anno::in_group("Metallic Roughness"),
374
+ anno::display_name("Metal/Rough Texture"),
375
+ anno::description("Metallic in the red or blue component and roughness in the green component. Influenced by the 'Metallic Factor' and 'Roughness Factor'."),
376
+ anno::enable_if("metallic_factor>0.0 || roughness_factor>0.0")
377
+ ]],
378
+
379
+ // KHR_materials_ior
380
+ uniform float ior = 1.5
381
+ [[
382
+ anno::hard_range(1.00, 5.0),
383
+ anno::in_group("Metallic Roughness"),
384
+ anno::display_name("IOR"),
385
+ anno::description("The index of refraction.")
386
+ ]],
387
+
388
+ // normal map
389
+ gltf_normal_texture_lookup_value normal_texture = gltf_normal_texture_lookup()
390
+ [[
391
+ anno::in_group("Normal Mapping"),
392
+ anno::display_name("Normal Texture"),
393
+ anno::description("Base layer normal map.")
394
+ ]],
395
+
396
+ // KHR_materials_transmission
397
+ uniform float transmission_factor = 0.0
398
+ [[
399
+ anno::hard_range(0.0, 1.0),
400
+ anno::in_group("Transmission"),
401
+ anno::display_name("Transmission Factor"),
402
+ anno::description("The base percentage of light that is transmitted through the surface. Multiplied to the 'Transmission Texture' if available.")
403
+ ]],
404
+ gltf_texture_lookup_value transmission_texture = gltf_texture_lookup()
405
+ [[
406
+ anno::in_group("Transmission"),
407
+ anno::display_name("Transmission Texture"),
408
+ anno::description("A texture that defines the transmission percentage of the surface, stored in the R channel. Influenced by the 'Transmission Factor'."),
409
+ anno::enable_if("transmission_factor>0")
410
+ ]],
411
+
412
+ // KHR_materials_sheen
413
+ uniform color sheen_color_factor = color(0.0)
414
+ [[
415
+ anno::in_group("Sheen"),
416
+ anno::display_name("Sheen Color Factor"),
417
+ anno::description("The sheen color in linear space. Multiplied to the 'Sheen Color Texture' if available.")
418
+ ]],
419
+ gltf_texture_lookup_value sheen_color_texture = gltf_texture_lookup()
420
+ [[
421
+ anno::in_group("Sheen"),
422
+ anno::display_name("Sheen Color Texture"),
423
+ anno::description("The sheen color (RGB). The sheen color is in sRGB transfer function. Influenced by the 'Sheen Color Factor'.")
424
+ ]],
425
+ uniform float sheen_roughness_factor = 0.0
426
+ [[
427
+ anno::hard_range(0.0, 1.0),
428
+ anno::in_group("Sheen"),
429
+ anno::display_name("Sheen Roughness Factor"),
430
+ anno::description("The sheen roughness. Multiplied to the 'Sheen Roughness Texture' if available.")
431
+ ]],
432
+ gltf_texture_lookup_value sheen_roughness_texture = gltf_texture_lookup()
433
+ [[
434
+ anno::in_group("Sheen"),
435
+ anno::display_name("Sheen Roughness Texture"),
436
+ anno::description("The sheen roughness (Alpha) texture. Influenced by the 'Sheen Roughness Factor'.")
437
+ ]],
438
+
439
+ // KHR_materials_clearcoat
440
+ uniform float clearcoat_factor = 0.0
441
+ [[
442
+ anno::hard_range(0.0, 1.0),
443
+ anno::in_group("Clearcoat"),
444
+ anno::display_name("Clearcoat Factor"),
445
+ anno::description("Strength of the clearcoat. Multiplied to the 'Clearcoat Texture' if available.")
446
+ ]],
447
+ gltf_texture_lookup_value clearcoat_texture = gltf_texture_lookup()
448
+ [[
449
+ anno::in_group("Clearcoat"),
450
+ anno::display_name("Clearcoat Texture"),
451
+ anno::description("Strength of the clearcoat. Influenced by the 'Clearcoat Factor'."),
452
+ anno::enable_if("clearcoat_factor>0")
453
+ ]],
454
+ uniform float clearcoat_roughness_factor = 0.0
455
+ [[
456
+ anno::hard_range(0.0, 1.0),
457
+ anno::in_group("Clearcoat"),
458
+ anno::display_name("Clearcoat Roughness Factor"),
459
+ anno::description("The clearcoat layer roughness. Multiplied to the 'Clearcoat Roughness Texture' if available."),
460
+ anno::enable_if("clearcoat_factor>0.0")
461
+ ]],
462
+ gltf_texture_lookup_value clearcoat_roughness_texture = gltf_texture_lookup()
463
+ [[
464
+ anno::in_group("Clearcoat"),
465
+ anno::display_name("Clearcoat Roughness Texture"),
466
+ anno::description("The clearcoat layer roughness texture. Influenced by the 'Clearcoat Roughness Texture'."),
467
+ anno::enable_if("clearcoat_factor>0.0 && clearcoat_roughness_factor>0.0")
468
+ ]],
469
+ gltf_normal_texture_lookup_value clearcoat_normal_texture = gltf_normal_texture_lookup()
470
+ [[
471
+ anno::in_group("Clearcoat"),
472
+ anno::display_name("Clearcoat Normal"),
473
+ anno::description("The clearcoat normal map texture."),
474
+ anno::enable_if("clearcoat_factor>0.0")
475
+ ]],
476
+
477
+ // emission
478
+ uniform color emissive_factor = color(0.0)
479
+ [[
480
+ anno::in_group("Emission"),
481
+ anno::display_name("Emissive Factor"),
482
+ anno::description("The emissive color of the material. Multiplied to the 'Emissive Texture' if available.")
483
+ ]],
484
+ gltf_texture_lookup_value emissive_texture = gltf_texture_lookup()
485
+ [[
486
+ anno::in_group("Emission"),
487
+ anno::display_name("Emissive Texture"),
488
+ anno::description("The emissive map texture. Influenced by the 'Emissive Factor'."),
489
+ anno::enable_if("::math::average(emissive_factor)>0.0")
490
+ ]],
491
+ // KHR_materials_emissive_strength
492
+ uniform float emissive_strength = 1.0
493
+ [[
494
+ anno::soft_range(0.0, 1000),
495
+ anno::in_group("Emission"),
496
+ anno::display_name("Emissive Strength"),
497
+ anno::description("The maximum strength of the emissive texture. Multiplied to the 'Emissive Factor'."),
498
+ anno::enable_if("::math::average(emissive_factor)>0.0")
499
+ ]],
500
+
501
+ // KHR_materials_volume
502
+ uniform bool thin_walled = true
503
+ [[
504
+ anno::in_group("Volume"),
505
+ anno::display_name("Thin-walled"),
506
+ anno::description("If true the material is thin-walled. Otherwise the material is a volume boundary. The doubleSided property has no effect on volume boundaries. Note, the thickness parameters are ignored since ray-tracing is used to compute the travelled distance within the volume.")
507
+ ]],
508
+ uniform float attenuation_distance = 0.0
509
+ [[
510
+ anno::soft_range(0.0, ::limits::FLOAT_MAX),
511
+ anno::in_group("Volume"),
512
+ anno::display_name("Attenuation Distance"),
513
+ anno::description("Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space. A value 0.0 disables it")
514
+ ]],
515
+ uniform color attenuation_color = color(1.0)
516
+ [[
517
+ anno::in_group("Volume"),
518
+ anno::display_name("Attenuation Color"),
519
+ anno::description("The color that white light turns into due to absorption when reaching the attenuation distance.")
520
+ ]],
521
+
522
+ // ambient occlusion
523
+ gltf_texture_lookup_value occlusion_texture = gltf_texture_lookup()
524
+ [[
525
+ anno::in_group("Occlusion"),
526
+ anno::display_name("Occlusion Texture"),
527
+ anno::description("The occlusion map texture. Influenced by the 'Occlusion Strength'.")
528
+ ]],
529
+ uniform float occlusion_strength = 1.0
530
+ [[
531
+ anno::hard_range(0.0, 1.0),
532
+ anno::in_group("Occlusion"),
533
+ anno::display_name("Occlusion Strength"),
534
+ anno::description("A scalar multiplier controlling the amount of occlusion applied. Multiplied to the 'Occlusion Texture'.")
535
+ ]],
536
+
537
+ // alpha
538
+ uniform gltf_alpha_mode alpha_mode = opaque
539
+ [[
540
+ anno::in_group("Opacity"),
541
+ anno::display_name("Alpha Mode"),
542
+ anno::description("Select how to interpret the alpha value.")
543
+ ]],
544
+ uniform float base_alpha = 1.0
545
+ [[
546
+ anno::hard_range(0.0, 1.0),
547
+ anno::in_group("Opacity"),
548
+ anno::display_name("Base Alpha"),
549
+ anno::description("Select between transparent (0.0) and opaque (1.0). Multiplied to the base color texture alpha channel if available."),
550
+ anno::enable_if("alpha_mode!=opaque")
551
+ ]],
552
+ // alpha for gltf_alpha_mode::mask
553
+ uniform float alpha_cutoff = 0.5
554
+ [[
555
+ anno::hard_range(0.0, 1.0),
556
+ anno::in_group("Opacity"),
557
+ anno::display_name("Alpha Cutoff"),
558
+ anno::description("Threshold to decide between fully transparent and fully opaque when alpha mode is 'mask'."),
559
+ anno::enable_if("alpha_mode==mask")
560
+ ]],
561
+
562
+ uniform string vertex_color_name = string("displayColor")
563
+ [[
564
+ anno::in_group("Primvar"),
565
+ anno::display_name("Vertex Color Name"),
566
+ anno::description("Name of the vertex color primvar usually COLOR_0(gltf), or displayColor(usd)")
567
+ ]],
568
+
569
+ uniform bool use_vertex_color_alpha = false
570
+ [[
571
+ anno::in_group("Primvar"),
572
+ anno::display_name("Use Opacity Channel From Vertex Color"),
573
+ anno::description("Multipy the Alpha or .w channel from the vertex color with the base alpha value.")
574
+ ]],
575
+
576
+ uniform string vertex_opacity_name = string("displayOpacity")
577
+ [[
578
+ anno::in_group("Primvar"),
579
+ anno::display_name("Vertex Opacity Name"),
580
+ anno::description("Name of the vertex opacity primvar usually the fourth component of COLOR_0(gltf), or displayOpacity(usd)")
581
+ ]]
582
+
583
+ ) [[
584
+ anno::author("NVIDIA Corporation"),
585
+ anno::display_name("GLTF Material - Metallic-Roughness"),
586
+ anno::description("Metallic-Roughness Material that takes the GLTF PBR model and KHR extension parameters as input.")
587
+ ]] = let {
588
+
589
+ // handling GLTF parameters
590
+ // ------------------------------------------------------------------------
591
+
592
+ float4 base_float4 = gltf_prepare_tex_float4(base_color_texture) * ::scene::data_lookup_float4(vertex_color_name, float4(1.0)); // apply vertex color
593
+ color base_color = base_color_factor * color(base_float4.x, base_float4.y, base_float4.z);
594
+
595
+ float alpha = base_alpha * (use_vertex_color_alpha == 1 ? base_float4.w : 1.0) * ((vertex_color_name != vertex_opacity_name) ? ::scene::data_lookup_float(vertex_opacity_name, float(1.0)) : 1.0);
596
+
597
+ float3 metallic_roughness = gltf_prepare_tex_float3(metallic_roughness_texture);
598
+ float metallic = metallic_factor * metallic_roughness.z;
599
+ float roughness = roughness_factor * metallic_roughness.y;
600
+
601
+ float3 normal = gltf_prepare_normal(normal_texture);
602
+ float occlusion = gltf_prepare_occlusion(occlusion_texture, occlusion_strength);
603
+ color emissive_color = gltf_perpare_emission(emissive_texture, emissive_factor * math::max(0.0f, emissive_strength));
604
+
605
+ // KHR_materials_specular
606
+ // ------------------------------------------------------------------------
607
+ color specular_color = color(gltf_prepare_tex_float3(specular_color_texture)) * specular_color_factor;
608
+ float specular = gltf_prepare_tex_float4(specular_texture).w * specular_factor;
609
+
610
+ // KHR_materials_transmission
611
+ // ------------------------------------------------------------------------
612
+ float transmission = gltf_prepare_tex_float4(transmission_texture).x * transmission_factor;
613
+
614
+ // KHR_materials_sheen
615
+ // ------------------------------------------------------------------------
616
+ color sheen_color = color(gltf_prepare_tex_float3(sheen_color_texture)) * sheen_color_factor;
617
+ float sheen_roughness = gltf_prepare_tex_float4(sheen_roughness_texture).w * sheen_roughness_factor;
618
+
619
+ // KHR_materials_clearcoat
620
+ // ------------------------------------------------------------------------
621
+ float clearcoat_blend = gltf_prepare_tex_float3(clearcoat_texture).x * clearcoat_factor;
622
+ float clearcoat_roughness = gltf_prepare_tex_float3(clearcoat_roughness_texture).y * clearcoat_roughness_factor;
623
+ float clearcoat_roughness2 = clearcoat_roughness * clearcoat_roughness;
624
+ float3 clearcoat_normal = gltf_prepare_normal(clearcoat_normal_texture);
625
+ float grazing_refl_coat = math::max((1.0 - clearcoat_roughness), 0.0);
626
+
627
+ // metallic roughness model
628
+ // ------------------------------------------------------------------------
629
+
630
+ // compute final roughness by squaring the "roughness" parameter
631
+ float roughness2 = roughness * roughness;
632
+
633
+ // reduce the reflectivity at grazing angles to avoid "dark edges"
634
+ // for high roughness due to the layering
635
+ float grazing_refl = math::max((1.0 - roughness), 0.0);
636
+
637
+ // fresnel term based on ior
638
+ float f0 = math::pow((ior - 1.0)/(ior + 1.0), 2.0);
639
+
640
+ // for the dielectric component we layer the glossy component on top of the diffuse one,
641
+ // the glossy layer has no color tint
642
+ bsdf dielectric_component = df::color_custom_curve_layer(
643
+ weight: color(1.0), // roughness is used to weight between diffuse and glossy
644
+ normal_reflectivity: math::min(f0 * specular_color, color(1.0)) * specular,
645
+ grazing_reflectivity: color(grazing_refl * specular),
646
+ layer: df::microfacet_ggx_vcavities_bsdf(roughness_u: roughness2),
647
+ base: df::weighted_layer(
648
+ weight: transmission,
649
+ base: df::diffuse_reflection_bsdf(tint: base_color * occlusion),
650
+ layer: df::microfacet_ggx_vcavities_bsdf(
651
+ roughness_u: roughness2,
652
+ tint: base_color * occlusion,
653
+ mode: df::scatter_transmit)),
654
+ normal: normal
655
+ );
656
+
657
+ // the metallic component doesn't have a diffuse component,
658
+ // its only glossy base_color is applied to tint it
659
+ bsdf metallic_component = df::microfacet_ggx_vcavities_bsdf(
660
+ tint: base_color * occlusion,
661
+ roughness_u: roughness2);
662
+
663
+ // apply sheen to the dielectic component
664
+ // add the sheen_color as weight in an outer layer to be able to blend and disable on default
665
+ // otherwise, sheen would be applied and tinted black
666
+ bsdf dielectric_sheen_component = df::color_weighted_layer(
667
+ weight: sheen_color,
668
+ layer: df::sheen_bsdf(
669
+ roughness: sheen_roughness * sheen_roughness,
670
+ tint: color(1.0),
671
+ multiscatter_tint: color(1.0),
672
+ multiscatter: dielectric_component
673
+ ),
674
+ base: dielectric_component);
675
+
676
+ // final BSDF is a linear blend between dielectric and metallic component
677
+ bsdf dielectric_metal_mix = df::weighted_layer(
678
+ weight: metallic,
679
+ base: dielectric_sheen_component,
680
+ layer: metallic_component,
681
+ normal: normal);
682
+
683
+ bsdf clearcoated = df::custom_curve_layer(
684
+ weight: clearcoat_blend,
685
+ normal_reflectivity: 0.04,
686
+ grazing_reflectivity: grazing_refl_coat,
687
+ layer: df::microfacet_ggx_vcavities_bsdf(
688
+ mode: df::scatter_reflect,
689
+ roughness_u: clearcoat_roughness2,
690
+ tint: color(1.0)),
691
+ base: df::weighted_layer(
692
+ weight: 1.0,
693
+ layer: dielectric_metal_mix,
694
+ normal: normal),
695
+ normal: clearcoat_normal);
696
+
697
+ } in material(
698
+ thin_walled: thin_walled,
699
+ surface: material_surface(
700
+ scattering: clearcoated,
701
+ emission: material_emission (
702
+ emission: df::diffuse_edf(),
703
+ intensity: emissive_color * ::math::PI
704
+ )
705
+ ),
706
+ volume: material_volume(
707
+ absorption_coefficient: thin_walled ? color(0.0) : (attenuation_distance == 0) ? color(0.0) : -math::log(attenuation_color) / attenuation_distance
708
+ ),
709
+ ior: color(ior),
710
+ geometry: material_geometry(
711
+ cutout_opacity: compute_opacity(alpha_mode, alpha, alpha_cutoff)
712
+ )
713
+ );
714
+
715
+
716
+ export material gltf_material_khr_specular_glossiness(
717
+ // diffuse color
718
+ uniform color diffuse_factor = color(1.0)
719
+ [[
720
+ anno::in_group("PBR Specular Glossiness"),
721
+ anno::display_name("Diffuse Factor"),
722
+ anno::description("The diffuse color of the material. Multiplied to the 'Diffuse Texture' if available.")
723
+ ]],
724
+ gltf_texture_lookup_value diffuse_texture = gltf_texture_lookup()
725
+ [[
726
+ anno::in_group("PBR Specular Glossiness"),
727
+ anno::display_name("Diffuse Texture"),
728
+ anno::description("The diffuse color of the material. Influenced by the 'Diffuse Factor'.")
729
+ ]],
730
+
731
+ // specular glossiness
732
+ uniform color specular_factor = 1.0
733
+ [[
734
+ anno::in_group("PBR Specular Glossiness"),
735
+ anno::display_name("Specular Factor"),
736
+ anno::description("The specular color of the material. Multiplied to the rgb values of the 'Specular/Glossy Texture' if available.")
737
+ ]],
738
+ uniform float glossiness_factor = 1.0
739
+ [[
740
+ anno::hard_range(0.0, 1.0),
741
+ anno::in_group("PBR Specular Glossiness"),
742
+ anno::display_name("Glossiness Factor"),
743
+ anno::description("The glossiness of the material. Select between diffuse (0.0) and nearly specular (1.0). Multiplied to the alpha value of the 'Specular/Glossy Texture' if available.")
744
+ ]],
745
+ gltf_texture_lookup_value specular_glossiness_texture = gltf_texture_lookup()
746
+ [[
747
+ anno::in_group("PBR Specular Glossiness"),
748
+ anno::display_name("Specular/Glossy Texture"),
749
+ anno::description("The specular-glossiness texture. Influenced by the 'Specular Factor' and 'Glossiness Factor'.")
750
+ ]],
751
+
752
+ // normal map
753
+ gltf_normal_texture_lookup_value normal_texture = gltf_normal_texture_lookup()
754
+ [[
755
+ anno::in_group("Normal Mapping"),
756
+ anno::display_name("Normal Texture"),
757
+ anno::description("Base layer normal map.")
758
+ ]],
759
+
760
+ // emission
761
+ uniform color emissive_factor = color(0.0)
762
+ [[
763
+ anno::in_group("Emission"),
764
+ anno::display_name("Emissive Factor"),
765
+ anno::description("The emissive color of the material. Multiplied to the 'Emissive Texture' if available.")
766
+ ]],
767
+ gltf_texture_lookup_value emissive_texture = gltf_texture_lookup()
768
+ [[
769
+ anno::in_group("Emission"),
770
+ anno::display_name("Emissive Texture"),
771
+ anno::description("The emissive map texture. Influenced by the 'Emissive Factor'."),
772
+ anno::enable_if("::math::average(emissive_factor)>0.0")
773
+ ]],
774
+ // KHR_materials_emissive_strength
775
+ uniform float emissive_strength = 1.0
776
+ [[
777
+ anno::soft_range(0.0, 10000),
778
+ anno::in_group("Emission"),
779
+ anno::display_name("Emissive Strength"),
780
+ anno::description("The maximum strength of the emissive texture. Multiplied to the 'Emissive Factor'."),
781
+ anno::enable_if("::math::average(emissive_factor)>0.0")
782
+ ]],
783
+
784
+ // ambient occlusion
785
+ gltf_texture_lookup_value occlusion_texture = gltf_texture_lookup()
786
+ [[
787
+ anno::in_group("Occlusion"),
788
+ anno::display_name("Occlusion Texture"),
789
+ anno::description("The occlusion map texture. Influenced by the 'Occlusion Strength'.")
790
+ ]],
791
+ uniform float occlusion_strength = 1.0
792
+ [[
793
+ anno::hard_range(0.0, 1.0),
794
+ anno::in_group("Occlusion"),
795
+ anno::display_name("Occlusion Strength"),
796
+ anno::description("A scalar multiplier controlling the amount of occlusion applied. Multiplied to the 'Occlusion Texture'.")
797
+ ]],
798
+
799
+ // alpha
800
+ uniform gltf_alpha_mode alpha_mode = opaque
801
+ [[
802
+ anno::in_group("Opacity"),
803
+ anno::display_name("Alpha Mode"),
804
+ anno::description("Select how to interpret the alpha value.")
805
+ ]],
806
+ uniform float base_alpha = 1.0
807
+ [[
808
+ anno::hard_range(0.0, 1.0),
809
+ anno::in_group("Opacity"),
810
+ anno::display_name("Base Alpha"),
811
+ anno::description("Select between transparent (0.0) and opaque (1.0). Multiplied to the base color texture alpha channel if available."),
812
+ anno::enable_if("alpha_mode!=opaque")
813
+ ]],
814
+ // alpha for gltf_alpha_mode::mask
815
+
816
+ uniform float alpha_cutoff = 0.5
817
+ [[
818
+ anno::hard_range(0.0, 1.0),
819
+ anno::in_group("Opacity"),
820
+ anno::display_name("Alpha Cutoff"),
821
+ anno::description("Threshold to decide between fully transparent and fully opaque when alpha mode is 'mask'."),
822
+ anno::enable_if("alpha_mode==mask")
823
+ ]],
824
+
825
+ uniform string vertex_color_name_spec = string("displayColor")
826
+ [[
827
+ anno::in_group("Primvar"),
828
+ anno::display_name("Vertex Color Name"),
829
+ anno::description("Name of the vertex color primvar usually COLOR_0 'gltf', or displayColor 'usd'.")
830
+ ]],
831
+
832
+ uniform bool use_vertex_color_alpha_spec = false
833
+ [[
834
+ anno::in_group("Primvar"),
835
+ anno::display_name("Use Opacity Channel From Vertex Color"),
836
+ anno::description("Multipy the Alpha or .w channel from the vertex color with the base alpha value.")
837
+ ]],
838
+
839
+ uniform string vertex_opacity_name_spec = string("displayOpacity")
840
+ [[
841
+ anno::in_group("Primvar"),
842
+ anno::display_name("Vertex Opacity Name"),
843
+ anno::description("Name of the vertex color primvar usually the .w component of COLOR_0 'gltf', or displayOpacity 'usd'.")
844
+ ]]
845
+
846
+ ) [[
847
+ anno::author("NVIDIA Corporation"),
848
+ anno::display_name("GLTF Material - Specular-Glossiness"),
849
+ anno::description("Specular-Glossiness Material that takes the GLTF KHR extension parameters as input.")
850
+ ]] = let {
851
+
852
+ // handling GLTF parameters
853
+ // ------------------------------------------------------------------------
854
+ float4 diffuse_float4 = gltf_prepare_tex_float4(diffuse_texture) * ::scene::data_lookup_float4(vertex_color_name_spec, float4(1.0)); // apply vertex color
855
+ color diffuse = diffuse_factor * color(diffuse_float4.x, diffuse_float4.y, diffuse_float4.z);
856
+
857
+ float alpha = base_alpha * (use_vertex_color_alpha_spec == 1 ? diffuse_float4.w : 1.0) * ((vertex_color_name_spec != vertex_opacity_name_spec) ? ::scene::data_lookup_float(vertex_opacity_name_spec, float(1.0)) : 1.0);
858
+ //float alpha = base_alpha;
859
+ float4 specular_glossiness = gltf_prepare_tex_float4(specular_glossiness_texture);
860
+ color specular = specular_factor * color(specular_glossiness.x, specular_glossiness.y, specular_glossiness.z);
861
+ float glossiness = glossiness_factor * specular_glossiness.w;
862
+
863
+ float3 normal = gltf_prepare_normal(normal_texture);
864
+ float occlusion = gltf_prepare_occlusion(occlusion_texture, occlusion_strength);
865
+ color emissive_color = gltf_perpare_emission(emissive_texture, emissive_factor * math::max(0.0f, emissive_strength));
866
+
867
+ // specular glossiness model
868
+ // ------------------------------------------------------------------------
869
+
870
+ //color c_diff = diffuse * (1.0 - math::maxvalue(specular));
871
+ float F_0 = math::max_value(specular);
872
+ color F_0_tint = F_0==0.0? color(0.0) : (specular/F_0);
873
+
874
+ float a = (1.0 - glossiness) * (1.0 - glossiness);
875
+
876
+ // diffuse BRDF
877
+ bsdf diffuse_brdf = df::diffuse_reflection_bsdf(
878
+ tint: diffuse * occlusion,
879
+ roughness: 0.0);
880
+
881
+ // specular BRDF
882
+ bsdf specular_brdf = df::microfacet_ggx_smith_bsdf(
883
+ tint: color(occlusion),
884
+ roughness_u: a,
885
+ roughness_v: a,
886
+ tangent_u: state::texture_tangent_u(0));
887
+ bsdf tinted_specular = df::directional_factor(normal_tint: F_0_tint, grazing_tint: color(1.0), exponent: 5.0, base: specular_brdf);
888
+ //- Custom curve for specular/diffuse angular mix
889
+ bsdf diffuse_specular_mix = df::custom_curve_layer(
890
+ normal_reflectivity: F_0,
891
+ grazing_reflectivity: 1.0,
892
+ exponent: 5.0,
893
+ weight: 1.0,
894
+ layer: tinted_specular,
895
+ base: diffuse_brdf,
896
+ normal: normal);
897
+
898
+ } in material(
899
+ surface: material_surface(
900
+ scattering: diffuse_specular_mix,
901
+ emission: material_emission (
902
+ emission: df::diffuse_edf(),
903
+ intensity: emissive_color * ::math::PI
904
+ )
905
+ ),
906
+ geometry: material_geometry(
907
+ normal: normal,
908
+ cutout_opacity: compute_opacity(alpha_mode, alpha, alpha_cutoff)
909
+ )
910
+ );
saved/assets/_dependencies/public_validation/187c8de5cf3b71e7/OmniGlass_1.mdl ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.4;
30
+ import ::anno::*;
31
+ import ::base::*;
32
+
33
+ using OmniGlass_Opacity_1 import OmniGlass_Opacity;
34
+ export annotation distill_off();
35
+
36
+
37
+ export material OmniGlass
38
+ (
39
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
40
+ [[
41
+ anno::hidden(),
42
+ anno::unused()
43
+ ]],
44
+ uniform bool use_glass_color_texture = false
45
+ [[
46
+ anno::hidden(),
47
+ anno::unused()
48
+ ]],
49
+ uniform color glass_color = color(1.f, 1.f, 1.f)
50
+ [[
51
+ anno::display_name("Glass Color"),
52
+ anno::description("Sets the color of the glass"),
53
+ anno::hard_range(color(0.0), color(1.0)),
54
+ anno::in_group("Color")
55
+ ]],
56
+ uniform texture_2d glass_color_texture = texture_2d()
57
+ [[
58
+ anno::display_name("Glass Color Texture"),
59
+ anno::description("Specifies the texture to be used for the glass color of the material"),
60
+ anno::in_group("Color")
61
+ ]],
62
+ float frosting_roughness = 0.f
63
+ [[
64
+ anno::display_name("Glass Roughness"),
65
+ anno::description("Sets the roughness of the glass material "),
66
+ anno::hard_range(0.0, 1.0),
67
+ anno::in_group("Roughness")
68
+ ]],
69
+ uniform float glass_ior = 1.491f
70
+ [[
71
+ anno::display_name("Glass IOR"),
72
+ anno::description("Sets IOR of the glass material "),
73
+ anno::soft_range(1.0f, 4.0f),
74
+ anno::in_group("Refraction")
75
+ ]],
76
+ uniform bool thin_walled = false
77
+ [[
78
+ anno::display_name("Thin Walled"),
79
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
80
+ anno::in_group("Refraction")
81
+ ]],
82
+ uniform float depth = 0.001f
83
+ [[
84
+ anno::description("Controls how much light is absorbed through the surface"),
85
+ anno::display_name("Volume Absorption Scale"),
86
+ anno::in_group("Color"),
87
+ anno::soft_range(0.f, 1.f),
88
+ anno::hard_range(0.f, 1000.f)
89
+ ]],
90
+ float roughness_texture_influence = 1.f
91
+ [[
92
+ anno::display_name("Roughness Texture Influence"),
93
+ anno::in_group("Roughness"),
94
+ anno::hard_range(0.0f, 1.0f)
95
+ ]],
96
+ uniform texture_2d roughness_texture = texture_2d()
97
+ [[
98
+ anno::description("The roughness texture"),
99
+ anno::display_name("Roughness Texture"),
100
+ anno::in_group("Roughness"),
101
+ anno::usage("roughness")
102
+ ]],
103
+ uniform texture_2d reflection_color_texture = texture_2d()
104
+ [[
105
+ anno::description("The reflection color texture"),
106
+ anno::display_name("Reflection Color Texture"),
107
+ anno::in_group("Reflection")
108
+ ]],
109
+ uniform color reflection_color = color(1.f, 1.f, 1.f)
110
+ [[
111
+ anno::display_name("Reflection Color"),
112
+ anno::in_group("Reflection")
113
+ ]],
114
+ uniform texture_2d normal_map_texture = texture_2d()
115
+ [[
116
+ anno::description("The normal map texture"),
117
+ anno::display_name("Normal Map Texture"),
118
+ anno::in_group("Normal"),
119
+ anno::usage("normal")
120
+ ]],
121
+ uniform float normal_map_strength = 1.0
122
+ [[
123
+ anno::description("Determines the degree of bumpiness"),
124
+ anno::display_name("Normal Map Strength"),
125
+ anno::in_group("Normal"),
126
+ anno::usage(""),
127
+ anno::soft_range(0.f, 1.f)
128
+ ]],
129
+ uniform float geometry_normal_roughness_strength = 1.f
130
+ [[
131
+ anno::hard_range(0.f, 1.f),
132
+ anno::display_name("Normal map to roughness weight"),
133
+ anno::description("Enables and weights roughness induced by normal maps"),
134
+ anno::in_group("Normal")
135
+ ]],
136
+ uniform bool flip_tangent_u = false
137
+ [[
138
+ anno::display_name("Normal Map Flip U Tangent"),
139
+ anno::in_group("Normal")
140
+ ]],
141
+ uniform bool flip_tangent_v = true
142
+ [[
143
+ anno::display_name("Normal Map Flip V Tangent"),
144
+ anno::in_group("Normal")
145
+ ]],
146
+
147
+ // Cutout Opacity
148
+ uniform bool enable_opacity = false
149
+ [[
150
+ anno::display_name("Enable Opacity"),
151
+ anno::description("Enables the use of cutout opacity"),
152
+ anno::in_group("Opacity")
153
+ ]],
154
+ uniform float cutout_opacity = 1.0f
155
+ [[
156
+ anno::hard_range(0.0, 1.0),
157
+ anno::display_name("Opacity Amount"),
158
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
159
+ anno::in_group("Opacity")
160
+ ]],
161
+ uniform texture_2d cutout_opacity_texture = texture_2d()
162
+ [[
163
+ anno::description("The opacity map"),
164
+ anno::display_name("Opacity Map"),
165
+ anno::in_group("Opacity"),
166
+ anno::usage("opacity")
167
+ ]],
168
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha
169
+ [[
170
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
171
+ anno::display_name("Opacity Mono Source"),
172
+ anno::in_group("Opacity"),
173
+ anno::usage("")
174
+ ]],
175
+ uniform float opacity_threshold = 0.f
176
+ [[
177
+ anno::hard_range(0.0, 1.0),
178
+ anno::display_name("Opacity Threshold"),
179
+ 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"),
180
+ anno::in_group("Opacity")
181
+ ]],
182
+
183
+ // UV Projection Group
184
+ uniform bool project_uvw = false
185
+ [[
186
+ anno::display_name("Enable Project UVW Coordinates"),
187
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
188
+ anno::in_group("UV")
189
+ ]],
190
+ uniform bool world_or_object = false
191
+ [[
192
+ anno::display_name("Enable World Space"),
193
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
194
+ anno::in_group("UV")
195
+ ]],
196
+
197
+ // UV Space Selector
198
+ uniform int uv_space_index = 0
199
+ [[
200
+ anno::display_name("UV Space Index"),
201
+ anno::description("Choose the UV Space Index to be used"),
202
+ anno::in_group("UV"),
203
+ anno::hard_range(0, 3)
204
+ ]],
205
+ uniform float2 texture_translate = float2(0.0f)
206
+ [[
207
+ anno::display_name("Texture Translate"),
208
+ anno::description("Controls the position of the texture."),
209
+ anno::in_group("UV")
210
+ ]],
211
+ uniform float texture_rotate = 0.f
212
+ [[
213
+ anno::display_name("Texture Rotate"),
214
+ anno::description("Rotates angle of the texture in degrees."),
215
+ anno::in_group("UV")
216
+ ]],
217
+ uniform float2 texture_scale = float2(1.0f)
218
+ [[
219
+ anno::display_name("Texture Tiling"),
220
+ anno::description("Controls repetition of the texture."),
221
+ anno::in_group("UV")
222
+ ]]
223
+ )
224
+ [[
225
+ anno::author("NVIDIA CORPORATION"),
226
+ anno::display_name("Omni Glass"),
227
+ anno::version( 1, 0, 0),
228
+ anno::in_group("Base"),
229
+ anno::description("Omni Glass Material V2"),
230
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
231
+ distill_off()
232
+ ]]
233
+ = OmniGlass_Opacity(
234
+ glass_color: glass_color,
235
+ glass_color_texture: glass_color_texture,
236
+ frosting_roughness: frosting_roughness,
237
+ glass_ior: glass_ior,
238
+ thin_walled: thin_walled,
239
+ depth: depth,
240
+ roughness_texture_influence: roughness_texture_influence,
241
+ roughness_texture: roughness_texture,
242
+ reflection_color_texture: reflection_color_texture,
243
+ reflection_color: reflection_color,
244
+ normal_map_texture: normal_map_texture,
245
+ normal_map_strength: normal_map_strength,
246
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
247
+ flip_tangent_u: flip_tangent_u,
248
+ flip_tangent_v: flip_tangent_v,
249
+ enable_opacity: enable_opacity,
250
+ cutout_opacity: cutout_opacity,
251
+ cutout_opacity_texture: cutout_opacity_texture,
252
+ cutout_opacity_mono_source: cutout_opacity_mono_source,
253
+ opacity_threshold: opacity_threshold,
254
+ project_uvw: project_uvw,
255
+ world_or_object: world_or_object,
256
+ uv_space_index: uv_space_index,
257
+ texture_translate: texture_translate,
258
+ texture_rotate: texture_rotate,
259
+ texture_scale: texture_scale
260
+ );
saved/assets/_dependencies/public_validation/5c86c8545a1e215e/OmniSurfacePresets.mdl ADDED
The diff for this file is too large to render. See raw diff
 
saved/assets/_dependencies/public_validation/8329bb517384e74a/color_204204204.hdr ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #?RADIANCE
2
+ FORMAT=32-bit_rle_rgbe
3
+
4
+ -Y 4 +X 4
5
+ ��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀
saved/assets/_dependencies/public_validation/86946aaf125cd299/OmniPBR_Opacity.mdl ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+ mdl 1.4;
29
+
30
+ import ::base::*;
31
+ import ::anno::*;
32
+
33
+ using OmniPBR_ClearCoat_Opacity import OmniPBR_ClearCoat_Opacity;
34
+
35
+
36
+
37
+ export material OmniPBR_Opacity(
38
+
39
+ color diffuse_color_constant = color(0.2f)
40
+ [[
41
+ anno::display_name("Base Color"),
42
+ anno::description("This is the base color"),
43
+ anno::in_group("Albedo")
44
+ ]],
45
+ uniform texture_2d diffuse_texture = texture_2d()
46
+ [[
47
+ anno::display_name("Albedo Map"),
48
+ anno::in_group("Albedo")
49
+ ]],
50
+ float albedo_desaturation = float(0.0)
51
+ [[
52
+ anno::display_name("Albedo Desaturation"),
53
+ anno::soft_range(float(0.0f), float(1.0f)),
54
+ anno::description("Desaturates the diffuse color"),
55
+ anno::in_group("Albedo")
56
+ ]],
57
+ float albedo_add = float(0.0)
58
+ [[
59
+ anno::display_name("Albedo Add"),
60
+ anno::soft_range(float(-1.0f), float(1.0f)),
61
+ anno::description("Adds a constant value to the diffuse color "),
62
+ anno::in_group("Albedo")
63
+ ]],
64
+ float albedo_brightness = float(1.0)
65
+ [[
66
+ anno::display_name("Albedo Brightness"),
67
+ anno::soft_range(float(0.0f), float(1.0f)),
68
+ anno::description("Multiplier for the diffuse color "),
69
+ anno::in_group("Albedo")
70
+ ]],
71
+ color diffuse_tint = color(1.0f)
72
+ [[
73
+ anno::display_name("Color Tint"),
74
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
75
+ anno::in_group("Albedo")
76
+ ]],
77
+
78
+
79
+ // -------------------- REFLECTIVITY ----------------------
80
+
81
+
82
+
83
+ float reflection_roughness_constant = 0.5f
84
+ [[
85
+ anno::display_name("Roughness Amount"),
86
+ anno::hard_range(0.0,1.),
87
+ anno::description("Higher roughness values lead to more blurry reflections"),
88
+ anno::in_group("Reflectivity")
89
+ ]],
90
+ float reflection_roughness_texture_influence = 0.0f
91
+ [[
92
+ anno::display_name("Roughness Map Influence"),
93
+ anno::hard_range(0.0, 1.),
94
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
95
+ anno::in_group("Reflectivity")
96
+ ]],
97
+ uniform texture_2d reflectionroughness_texture = texture_2d()
98
+ [[
99
+ anno::display_name("Roughness Map"),
100
+ anno::in_group("Reflectivity")
101
+ ]],
102
+
103
+
104
+ float metallic_constant = 0.f
105
+ [[
106
+ anno::display_name("Metallic Amount"),
107
+ anno::hard_range(0.0,1.),
108
+ anno::description("Metallic Material"),
109
+ anno::in_group("Reflectivity")
110
+ ]],
111
+ float metallic_texture_influence = 0.0f
112
+ [[
113
+ anno::display_name("Metallic Map Influence"),
114
+ anno::hard_range(0.0, 1.),
115
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
116
+ anno::in_group("Reflectivity")
117
+ ]],
118
+ uniform texture_2d metallic_texture = texture_2d()
119
+ [[
120
+ anno::display_name("Metallic Map"),
121
+ anno::in_group("Reflectivity")
122
+ ]],
123
+ float specular_level = float(0.5)
124
+ [[
125
+ anno::display_name("Specular"),
126
+ anno::soft_range(float(0.0f), float(1.0f)),
127
+ anno::description("The specular level (intensity) of the material"),
128
+ anno::in_group("Reflectivity")
129
+ ]],
130
+ // -------------------- ORM ----------------------
131
+ uniform bool enable_ORM_texture = false
132
+ [[
133
+ anno::display_name("Enable ORM Texture"),
134
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
135
+ anno::in_group("Reflectivity")
136
+ ]],
137
+ uniform texture_2d ORM_texture = texture_2d()
138
+ [[
139
+ anno::display_name("ORM Map"),
140
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
141
+ anno::in_group("Reflectivity")
142
+ ]],
143
+
144
+ // -------------------- AO Group ----------------------
145
+
146
+ float ao_to_diffuse = 0.0
147
+ [[
148
+ anno::display_name("AO to Diffuse"),
149
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
150
+ anno::in_group("AO"),
151
+ anno::hard_range(0.0f, 1.0f)
152
+ ]],
153
+ uniform texture_2d ao_texture = texture_2d()
154
+ [[
155
+ anno::display_name("Ambient Occlusion Map"),
156
+ anno::description("The Ambient Occlusion texture for the material"),
157
+ anno::in_group("AO")
158
+ ]],
159
+
160
+
161
+ // -------------------- EMISSIVE ----------------------
162
+
163
+
164
+ uniform bool enable_emission = false
165
+ [[
166
+ anno::display_name("Enable Emission"),
167
+ anno::description("Enables the emission of light from the material"),
168
+ anno::in_group("Emissive")
169
+ ]],
170
+
171
+ color emissive_color = color(1.0, 0.1, 0.1)
172
+ [[
173
+ anno::enable_if("enable_emission == true"),
174
+ anno::display_name("Emissive Color"),
175
+ anno::description("The emission color"),
176
+ anno::in_group("Emissive")
177
+
178
+ ]],
179
+ uniform texture_2d emissive_color_texture = texture_2d()
180
+ [[
181
+ anno::enable_if("enable_emission == true"),
182
+ anno::display_name("Emissive Color map"),
183
+ anno::in_group("Emissive"),
184
+ anno::description("The emissive color texture")
185
+ ]],
186
+ uniform texture_2d emissive_mask_texture = texture_2d()
187
+ [[
188
+ anno::enable_if("enable_emission == true"),
189
+ anno::display_name("Emissive Mask map"),
190
+ anno::description("The texture masking the emissive color"),
191
+ anno::in_group("Emissive")
192
+ ]],
193
+ uniform float emissive_intensity = 40.f
194
+ [[
195
+ anno::enable_if("enable_emission == true"),
196
+ anno::display_name("Emissive Intensity"),
197
+ anno::description("Intensity of the emission"),
198
+ anno::in_group("Emissive")
199
+ ]],
200
+
201
+ // Cutout Opacity
202
+ uniform bool enable_opacity = true
203
+ [[
204
+ anno::display_name("Enable Opacity"),
205
+ anno::description("Enables the use of cutout opacity"),
206
+ anno::in_group("Opacity")
207
+ ]],
208
+ uniform bool enable_opacity_texture = false
209
+ [[
210
+ anno::display_name("Enable Opacity Texture"),
211
+ anno::description("Enables or disables the usage of the opacity texture map"),
212
+ anno::in_group("Opacity")
213
+ ]],
214
+ uniform float opacity_constant = 1.f
215
+ [[
216
+ anno::hard_range(0.0, 1.0),
217
+ anno::display_name("Opacity Amount"),
218
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
219
+ anno::in_group("Opacity")
220
+ ]],
221
+ uniform texture_2d opacity_texture = texture_2d()
222
+ [[
223
+ anno::display_name("Opacity Map"),
224
+ anno::in_group("Opacity")
225
+ ]],
226
+ uniform base::mono_mode opacity_mode = base::mono_average
227
+ [[
228
+ anno::display_name("Opacity Mono Source"),
229
+ anno::in_group("Opacity"),
230
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum")
231
+ ]],
232
+ uniform float opacity_threshold = 0.f
233
+ [[
234
+ anno::hard_range(0.0, 1.0),
235
+ anno::display_name("Opacity Threshold"),
236
+ 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"),
237
+ anno::in_group("Opacity")
238
+ ]],
239
+
240
+ // -------------------- Normal ----------------------
241
+
242
+
243
+
244
+ /*
245
+ uniform bool enable_normalmap_texture = false
246
+ [[
247
+ anno::display_name("Enable Normal Texture"),
248
+ anno::description("Enables the usage of the normalmap texture"),
249
+ anno::in_group("Features")
250
+ ]],
251
+ */
252
+ uniform float bump_factor = 1.f
253
+ [[
254
+ anno::display_name("Normal Map Strength"),
255
+ anno::description("Strength of normal map."),
256
+ anno::in_group("Normal"),
257
+ anno::soft_range(0.0f, 1.0f)
258
+ ]],
259
+
260
+ uniform texture_2d normalmap_texture = texture_2d()
261
+ [[
262
+ anno::display_name("Normal Map"),
263
+ anno::description("Enables the usage of the normalmap texture"),
264
+ anno::in_group("Normal")
265
+ ]],
266
+
267
+
268
+
269
+ /* uniform bool enable_detail_normalmap_texture = false
270
+ [[
271
+ anno::display_name("Enable Detail Normal Texture"),
272
+ anno::in_group("Features"),
273
+ anno::description("Enables the usage of the detail normalmap texture")
274
+ ]],
275
+ */
276
+ uniform float detail_bump_factor = .3f
277
+ [[
278
+ anno::display_name("Detail Normal Strength"),
279
+ anno::in_group("Normal"),
280
+ anno::soft_range(0.0f, 1.0f),
281
+ anno::description("Strength of the detail normal")
282
+ ]],
283
+ uniform texture_2d detail_normalmap_texture = texture_2d()
284
+ [[
285
+ anno::display_name("Detail Normal Map"),
286
+ anno::in_group("Normal")
287
+ ]],
288
+ // UV Projection Group
289
+ uniform bool project_uvw = false
290
+ [[
291
+ anno::display_name("Enable Project UVW Coordinates"),
292
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
293
+ anno::in_group("UV")
294
+ ]],
295
+ uniform bool world_or_object = false
296
+ [[
297
+ anno::enable_if("project_uvw == true"),
298
+ anno::display_name("Enable World Space"),
299
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
300
+ anno::in_group("UV")
301
+ ]],
302
+
303
+ uniform int uv_space_index = 0
304
+ [[
305
+ anno::enable_if("project_uvw == true"),
306
+ anno::display_name("UV Space Index"),
307
+ anno::description("UV Space Index."),
308
+ anno::in_group("UV"),
309
+ anno::hard_range(0, 3)
310
+ ]],
311
+
312
+ // Adjustments Group
313
+ uniform float2 texture_translate = float2(0.0f)
314
+ [[
315
+ anno::enable_if("project_uvw == true"),
316
+ anno::display_name("Texture Translate"),
317
+ anno::description("Controls position of texture."),
318
+ anno::in_group("UV")
319
+ ]],
320
+ uniform float texture_rotate = 0.f
321
+ [[
322
+ anno::enable_if("project_uvw == true"),
323
+ anno::display_name("Texture Rotate"),
324
+ anno::description("Rotates angle of texture in degrees."),
325
+ anno::in_group("UV")
326
+ ]],
327
+ uniform float2 texture_scale = float2(1.0f)
328
+ [[
329
+ anno::enable_if("project_uvw == true"),
330
+ anno::display_name("Texture Scale"),
331
+ anno::description("Larger number increases size of texture."),
332
+ anno::in_group("UV")
333
+ ]],
334
+
335
+ uniform float2 detail_texture_translate = float2(0.0f)
336
+ [[
337
+ anno::enable_if("project_uvw == true"),
338
+ anno::display_name("Detail Texture Translate"),
339
+ anno::description("Controls the position of the detail texture."),
340
+ anno::in_group("UV")
341
+ ]],
342
+ uniform float detail_texture_rotate = 0.f
343
+ [[
344
+ anno::enable_if("project_uvw == true"),
345
+ anno::display_name("Detail Texture Rotate"),
346
+ anno::description("Rotates angle of the detail texture in degrees."),
347
+ anno::in_group("UV")
348
+ ]],
349
+ uniform float2 detail_texture_scale = float2(1.0f)
350
+ [[
351
+ anno::enable_if("project_uvw == true"),
352
+ anno::display_name("Detail Texture Scale"),
353
+ anno::description("Larger numbers increase the size of the detail texture"),
354
+ anno::in_group("UV")
355
+ ]]
356
+ )
357
+ [[
358
+ anno::display_name("OmniPBR Opacity"),
359
+ anno::description("OmniPBR supports opacity and ORM textures"),
360
+ anno::in_group("Base"),
361
+ anno::version( 2, 1, 0),
362
+ anno::author("NVIDIA CORPORATION"),
363
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
364
+ ]]
365
+ = OmniPBR_ClearCoat_Opacity(
366
+ diffuse_texture: diffuse_texture,
367
+ albedo_desaturation: albedo_desaturation,
368
+ albedo_add: albedo_add,
369
+ albedo_brightness: albedo_brightness,
370
+ diffuse_color_constant: diffuse_color_constant,
371
+ diffuse_tint: diffuse_tint,
372
+ //ao
373
+ ao_texture: ao_texture,
374
+ ao_to_diffuse: ao_to_diffuse,
375
+ //ORM
376
+ ORM_texture: ORM_texture,
377
+ enable_ORM_texture: enable_ORM_texture,
378
+ //reflectivity
379
+ reflection_roughness_constant: reflection_roughness_constant,
380
+ reflectionroughness_texture: reflectionroughness_texture,
381
+ reflection_roughness_texture_influence: reflection_roughness_texture_influence,
382
+ metallic_constant: metallic_constant,
383
+ metallic_texture: metallic_texture,
384
+ metallic_texture_influence: metallic_texture_influence,
385
+ specular_level: specular_level,
386
+ //opacity
387
+ enable_opacity: enable_opacity,
388
+ enable_opacity_texture: enable_opacity_texture,
389
+ opacity_texture: opacity_texture,
390
+ opacity_constant: opacity_constant,
391
+ opacity_mode: opacity_mode,
392
+ opacity_threshold: opacity_threshold,
393
+ //emissive
394
+ enable_emission: enable_emission,
395
+ emissive_color: emissive_color,
396
+ emissive_color_texture: emissive_color_texture,
397
+ emissive_mask_texture: emissive_mask_texture,
398
+ emissive_intensity: emissive_intensity,
399
+ //clearcoat
400
+ enable_clearcoat: false,
401
+ clearcoat_tint: color(1.0f),
402
+ clearcoat_transparency: 1.0f,
403
+ clearcoat_reflection_roughness: 0.0f,
404
+ clearcoat_weight: 1.0f,
405
+ clearcoat_flatten: 1.0f,
406
+ clearcoat_ior: 1.56f,
407
+ clearcoat_bump_factor: 1.f,
408
+ clearcoat_normalmap_texture: texture_2d(),
409
+ //normal
410
+ normalmap_texture: normalmap_texture,
411
+ bump_factor: bump_factor,
412
+ detail_normalmap_texture: detail_normalmap_texture,
413
+ detail_bump_factor: detail_bump_factor,
414
+ project_uvw: project_uvw,
415
+ world_or_object: world_or_object,
416
+ uv_space_index: uv_space_index,
417
+ texture_translate: texture_translate,
418
+ texture_rotate: texture_rotate,
419
+ texture_scale: texture_scale,
420
+ detail_texture_translate: detail_texture_translate,
421
+ detail_texture_rotate: detail_texture_rotate,
422
+ detail_texture_scale: detail_texture_scale,
423
+ clearcoat_texture_translate: float2(0.0f),
424
+ clearcoat_texture_rotate: 0.0f,
425
+ clearcoat_texture_scale: float2(1.0f)
426
+ );
saved/assets/_dependencies/public_validation/d71555550deb30af/OmniGlass.mdl ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.4;
30
+ import ::anno::*;
31
+ import ::base::*;
32
+
33
+ using OmniGlass_Opacity import OmniGlass_Opacity;
34
+ export annotation distill_off();
35
+
36
+ export material OmniGlass(
37
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
38
+ [[
39
+ anno::hidden(),
40
+ anno::unused()
41
+ ]],
42
+ uniform bool use_glass_color_texture = false
43
+ [[
44
+ anno::hidden(),
45
+ anno::unused()
46
+ ]],
47
+ uniform color glass_color = color(1.f, 1.f, 1.f) [[
48
+ anno::display_name("Glass Color"),
49
+ anno::description("Sets the color of the glass"),
50
+ anno::hard_range(color(0.0), color(1.0)),
51
+ anno::in_group("Color")
52
+ ]],
53
+ uniform texture_2d glass_color_texture = texture_2d() [[
54
+ anno::display_name("Glass Color Texture"),
55
+ anno::description("Specifies the texture to be used for the glass color of the material"),
56
+ anno::in_group("Color")
57
+ ]],
58
+ float frosting_roughness = 0.f [[
59
+ anno::display_name("Glass Roughness"),
60
+ anno::description("Sets the roughness of the glass material "),
61
+ anno::hard_range(0.0, 1.0),
62
+ anno::in_group("Roughness")
63
+ ]],
64
+ uniform float glass_ior = 1.491f [[
65
+ anno::display_name("Glass IOR"),
66
+ anno::description("Sets IOR of the glass material "),
67
+ anno::soft_range(1.0f, 4.0f),
68
+ anno::in_group("Refraction")
69
+ ]],
70
+ uniform bool thin_walled = false [[
71
+ anno::display_name("Thin Walled"),
72
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
73
+ anno::in_group("Refraction")
74
+ ]],
75
+
76
+ // NEW PARAMETERS
77
+ uniform float depth = 0.001f [[
78
+ anno::description("Controls how much light is absorbed through the surface"),
79
+ anno::display_name("Volume Absorption Scale"),
80
+ anno::in_group("Color"),
81
+ anno::soft_range(0.f, 1.f),
82
+ anno::hard_range(0.f, 1000.f)
83
+ ]],
84
+ float roughness_texture_influence = 1.f [[
85
+ anno::display_name("Roughness Texture Influence"),
86
+ anno::in_group("Roughness"),
87
+ anno::hard_range(0.0f, 1.0f)
88
+ ]],
89
+ uniform texture_2d roughness_texture = texture_2d() [[
90
+ anno::description("The roughness texture"),
91
+ anno::display_name("Roughness Texture"),
92
+ anno::in_group("Roughness"),
93
+ anno::usage("roughness")
94
+ ]],
95
+ uniform texture_2d reflection_color_texture = texture_2d() [[
96
+ anno::description("The reflection color texture"),
97
+ anno::display_name("Reflection Color Texture"),
98
+ anno::in_group("Reflection")
99
+ ]],
100
+ uniform color reflection_color = color(1.f, 1.f, 1.f) [[
101
+ anno::display_name("Reflection Color"),
102
+ anno::in_group("Reflection")
103
+ ]],
104
+ uniform texture_2d normal_map_texture = texture_2d() [[
105
+ anno::description("The normal map texture"),
106
+ anno::display_name("Normal Map Texture"),
107
+ anno::in_group("Normal"),
108
+ anno::usage("normal")
109
+ ]],
110
+ uniform float normal_map_strength = 1.0 [[
111
+ anno::description("Determines the degree of bumpiness"),
112
+ anno::display_name("Normal Map Strength"),
113
+ anno::in_group("Normal"),
114
+ anno::usage(""),
115
+ anno::soft_range(0.f, 1.f)
116
+ ]],
117
+ uniform bool flip_tangent_u = false [[
118
+ anno::display_name("Normal Map Flip U Tangent"),
119
+ anno::in_group("Normal")
120
+ ]],
121
+ uniform bool flip_tangent_v = true [[
122
+ anno::display_name("Normal Map Flip V Tangent"),
123
+ anno::in_group("Normal")
124
+ ]],
125
+
126
+ // Cutout Opacity
127
+ uniform bool enable_opacity = false
128
+ [[
129
+ anno::display_name("Enable Opacity"),
130
+ anno::description("Enables the use of cutout opacity"),
131
+ anno::in_group("Opacity")
132
+ ]],
133
+ uniform float cutout_opacity = 1.0f [[
134
+ anno::hard_range(0.0, 1.0),
135
+ anno::display_name("Opacity Amount"),
136
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
137
+ anno::in_group("Opacity")
138
+ ]],
139
+ uniform texture_2d cutout_opacity_texture = texture_2d() [[
140
+ anno::description("The opacity map"),
141
+ anno::display_name("Opacity Map"),
142
+ anno::in_group("Opacity"),
143
+ anno::usage("opacity")
144
+ ]],
145
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha [[
146
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
147
+ anno::display_name("Opacity Mono Source"),
148
+ anno::in_group("Opacity"),
149
+ anno::usage("")
150
+ ]],
151
+ uniform float opacity_threshold = 0.f
152
+ [[
153
+ anno::hard_range(0.0, 1.0),
154
+ anno::display_name("Opacity Threshold"),
155
+ 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"),
156
+ anno::in_group("Opacity")
157
+ ]],
158
+
159
+ //
160
+ // End of new
161
+ //
162
+ // UV Projection Group
163
+ //
164
+ uniform bool project_uvw = false
165
+ [[
166
+ anno::display_name("Enable Project UVW Coordinates"),
167
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
168
+ anno::in_group("UV")
169
+ ]],
170
+ uniform bool world_or_object = false
171
+ [[
172
+ anno::display_name("Enable World Space"),
173
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
174
+ anno::in_group("UV")
175
+ ]],
176
+
177
+ // UV Space selector
178
+ uniform int uv_space_index = 0
179
+ [[
180
+ anno::display_name("UV Space Index"),
181
+ anno::description("Choose the UV Space Index to be used"),
182
+ anno::in_group("UV"),
183
+ anno::hard_range(0, 3)
184
+ ]],
185
+ uniform float2 texture_translate = float2(0.0f)
186
+ [[
187
+ anno::display_name("Texture Translate"),
188
+ anno::description("Controls the position of the texture."),
189
+ anno::in_group("UV")
190
+ ]],
191
+ uniform float texture_rotate = 0.f
192
+ [[
193
+ anno::display_name("Texture Rotate"),
194
+ anno::description("Rotates angle of the texture in degrees."),
195
+ anno::in_group("UV")
196
+ ]],
197
+ uniform float2 texture_scale = float2(1.0f)
198
+ [[
199
+ anno::display_name("Texture Tiling"),
200
+ anno::description("Controls repetition of the texture."),
201
+ anno::in_group("UV")
202
+ ]])
203
+ [[
204
+ anno::author("NVIDIA CORPORATION"),
205
+ anno::display_name("Omni Glass"),
206
+ anno::version( 1, 0, 0),
207
+ anno::in_group("Base"),
208
+ anno::description("Omni Glass Material V2"),
209
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
210
+ distill_off()
211
+ ]]
212
+ = OmniGlass_Opacity(
213
+ glass_color: glass_color,
214
+ glass_color_texture: glass_color_texture,
215
+ frosting_roughness: frosting_roughness,
216
+ glass_ior: glass_ior,
217
+ thin_walled: thin_walled,
218
+ depth: depth,
219
+ roughness_texture_influence: roughness_texture_influence,
220
+ roughness_texture: roughness_texture,
221
+ reflection_color_texture: reflection_color_texture,
222
+ reflection_color: reflection_color,
223
+ normal_map_texture: normal_map_texture,
224
+ normal_map_strength: normal_map_strength,
225
+ flip_tangent_u: flip_tangent_u,
226
+ flip_tangent_v: flip_tangent_v,
227
+ enable_opacity: enable_opacity,
228
+ cutout_opacity: cutout_opacity,
229
+ cutout_opacity_texture: cutout_opacity_texture,
230
+ cutout_opacity_mono_source: cutout_opacity_mono_source,
231
+ opacity_threshold: opacity_threshold,
232
+ project_uvw: project_uvw,
233
+ world_or_object: world_or_object,
234
+ uv_space_index: uv_space_index,
235
+ texture_translate: texture_translate,
236
+ texture_rotate: texture_rotate,
237
+ texture_scale: texture_scale
238
+ );
saved/assets/_dependencies/public_validation/e0591cdda9f21eb6/OmniPBR.mdl ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::anno::*;
38
+
39
+ import ::debug::*;
40
+
41
+ import ::nvidia::core_definitions::file_texture;
42
+ import ::nvidia::core_definitions::normalmap_texture;
43
+
44
+ import OmniPBR_ClearCoat::*;
45
+
46
+
47
+ // OmniPBR //
48
+
49
+ export material OmniPBR(
50
+
51
+ // Albdeo //
52
+
53
+ color diffuse_color_constant = color(0.2) [[
54
+ anno::display_name("Albedo Color"),
55
+ anno::description("This is the albedo base color"),
56
+ anno::in_group("Albedo")
57
+ ]],
58
+ uniform texture_2d diffuse_texture = texture_2d() [[
59
+ anno::display_name("Albedo Map"),
60
+ anno::in_group("Albedo")
61
+ ]],
62
+ float albedo_desaturation = float(0.0) [[
63
+ anno::display_name("Albedo Desaturation"),
64
+ anno::description("Desaturates the diffuse color"),
65
+ anno::in_group("Albedo"),
66
+ anno::soft_range(float(0.0), float(1.0))
67
+ ]],
68
+ float albedo_add = float(0.0) [[
69
+ anno::display_name("Albedo Add"),
70
+ anno::description("Adds a constant value to the diffuse color "),
71
+ anno::in_group("Albedo"),
72
+ anno::soft_range(float(-1.0), float(1.0))
73
+ ]],
74
+ float albedo_brightness = float(1.0) [[
75
+ anno::display_name("Albedo Brightness"),
76
+ anno::description("Multiplier for the diffuse color "),
77
+ anno::in_group("Albedo"),
78
+ anno::soft_range(float(0.0), float(1.0))
79
+ ]],
80
+ color diffuse_tint = color(1.0) [[
81
+ anno::display_name("Color Tint"),
82
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
83
+ anno::in_group("Albedo")
84
+ ]],
85
+
86
+
87
+ // Reflectivity //
88
+
89
+ float reflection_roughness_constant = float(0.5) [[
90
+ anno::display_name("Roughness Amount"),
91
+ anno::description("Higher roughness values lead to more blurry reflections"),
92
+ anno::in_group("Reflectivity"),
93
+ anno::hard_range(float(0.0), float(1.0))
94
+ ]],
95
+ float reflection_roughness_texture_influence = float(0.0) [[
96
+ anno::display_name("Roughness Map Influence"),
97
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
98
+ anno::in_group("Reflectivity"),
99
+ anno::hard_range(float(0.0), float(1.0))
100
+ ]],
101
+ uniform texture_2d reflectionroughness_texture = texture_2d() [[
102
+ anno::display_name("Roughness Map"),
103
+ anno::in_group("Reflectivity"),
104
+ anno::usage("roughness")
105
+ ]],
106
+ float metallic_constant = float(0.0) [[
107
+ anno::display_name("Metallic Amount"),
108
+ anno::description("Metallic Material"),
109
+ anno::in_group("Reflectivity"),
110
+ anno::hard_range(float(0.0), float(1.0))
111
+ ]],
112
+ float metallic_texture_influence = float(0.0) [[
113
+ anno::display_name("Metallic Map Influence"),
114
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
115
+ anno::in_group("Reflectivity"),
116
+ anno::hard_range(float(0.0), float(1.0))
117
+ ]],
118
+ uniform texture_2d metallic_texture = texture_2d() [[
119
+ anno::display_name("Metallic Map"),
120
+ anno::in_group("Reflectivity"),
121
+ anno::usage("metalness")
122
+ ]],
123
+ float specular_level = float(0.5) [[
124
+ anno::display_name("Specular"),
125
+ anno::description("The specular level (intensity) of the material"),
126
+ anno::in_group("Reflectivity"),
127
+ anno::soft_range(float(0.0), float(1.0))
128
+ ]],
129
+
130
+
131
+ // ORM //
132
+
133
+ uniform bool enable_ORM_texture = false [[
134
+ anno::display_name("Enable ORM Texture"),
135
+ anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
136
+ anno::in_group("Reflectivity")
137
+ ]],
138
+ uniform texture_2d ORM_texture = texture_2d() [[
139
+ anno::display_name("ORM Map"),
140
+ anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
141
+ anno::in_group("Reflectivity"),
142
+ anno::usage("roughness")
143
+ ]],
144
+
145
+
146
+ // AO Group //
147
+
148
+ float ao_to_diffuse = 0.0 [[
149
+ anno::display_name("AO to diffuse"),
150
+ anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
151
+ anno::in_group("AO"),
152
+ anno::hard_range(float(0.0), float(1.0))
153
+ ]],
154
+ uniform texture_2d ao_texture = texture_2d() [[
155
+ anno::display_name("Ambient Occlusion Map"),
156
+ anno::description("The ambient occlusion texture for the material"),
157
+ anno::in_group("AO"),
158
+ anno::usage("occlusion")
159
+ ]],
160
+
161
+
162
+ // Emission //
163
+
164
+ uniform bool enable_emission = false [[
165
+ anno::display_name("Enable Emission"),
166
+ anno::description("Enables the emission of light from the material"),
167
+ anno::in_group("Emissive")
168
+ ]],
169
+ color emissive_color = color(1.0,0.1,0.1) [[
170
+ anno::display_name("Emissive Color"),
171
+ anno::description("The emission color"),
172
+ anno::in_group("Emissive"),
173
+ anno::enable_if("enable_emission == true")
174
+ ]],
175
+ uniform texture_2d emissive_color_texture = texture_2d() [[
176
+ anno::display_name("Emissive Color map"),
177
+ anno::in_group("Emissive"),
178
+ anno::description("The emissive color texture"),
179
+ anno::enable_if("enable_emission == true")
180
+ ]],
181
+ uniform texture_2d emissive_mask_texture = texture_2d() [[
182
+ anno::display_name("Emissive Mask map"),
183
+ anno::description("The texture masking the emissive color"),
184
+ anno::in_group("Emissive"),
185
+ anno::enable_if("enable_emission == true"),
186
+ anno::usage("occlusion")
187
+ ]],
188
+ float emissive_intensity = float(40.0) [[
189
+ anno::display_name("Emissive Intensity"),
190
+ anno::description("Intensity of the emission"),
191
+ anno::in_group("Emissive"),
192
+ anno::enable_if("enable_emission == true")
193
+ ]],
194
+
195
+
196
+ // Cutout Opacity //
197
+
198
+ uniform bool enable_opacity = false [[
199
+ anno::display_name("Enable Opacity"),
200
+ anno::description("Enables the use of cutout opacity"),
201
+ anno::in_group("Opacity")
202
+ ]],
203
+ uniform texture_2d opacity_texture = texture_2d() [[
204
+ anno::display_name("Opacity Map"),
205
+ anno::in_group("Opacity"),
206
+ anno::usage("opacity")
207
+ ]],
208
+ float opacity_constant = float(1.0) [[
209
+ anno::display_name("Opacity Amount"),
210
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
211
+ anno::in_group("Opacity"),
212
+ anno::hard_range(float(0.0), float(1.0))
213
+ ]],
214
+ uniform bool enable_opacity_texture = false [[
215
+ anno::display_name("Enable Opacity Texture"),
216
+ anno::description("Enables or disables the usage of the opacity texture map"),
217
+ anno::in_group("Opacity")
218
+ ]],
219
+ uniform base::mono_mode opacity_mode = base::mono_average [[
220
+ anno::display_name("Opacity Mono Source"),
221
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
222
+ anno::in_group("Opacity")
223
+ ]],
224
+ uniform float opacity_threshold = float(0.0) [[
225
+ anno::hard_range(0.0, 1.0),
226
+ anno::display_name("Opacity Threshold"),
227
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
228
+ anno::in_group("Opacity")
229
+ ]],
230
+
231
+
232
+
233
+ // Normal //
234
+
235
+ uniform float geometry_normal_roughness_strength = 1.f
236
+ [[
237
+ anno::hard_range(0.0, 1.0),
238
+ anno::display_name("Normal map to roughness weight"),
239
+ anno::description("Enables and weights roughness induced by normal maps"),
240
+ anno::in_group("Normal")
241
+ ]],
242
+ uniform float bump_factor = float(1.0) [[
243
+ anno::display_name("Normal Strength"),
244
+ anno::description("Strength of normal map"),
245
+ anno::in_group("Normal"),
246
+ anno::soft_range(float(0.0), float(1.0))
247
+ ]],
248
+ uniform texture_2d normalmap_texture = texture_2d() [[
249
+ anno::display_name("Normal Map"),
250
+ anno::in_group("Normal"),
251
+ anno::usage("normal")
252
+ ]],
253
+ uniform float detail_bump_factor = float(0.3) [[
254
+ anno::display_name("Detail Normal Strength"),
255
+ anno::in_group("Normal"),
256
+ anno::description("Strength of the detail normal"),
257
+ anno::soft_range(float(0.0), float(1.0))
258
+ ]],
259
+ uniform texture_2d detail_normalmap_texture = texture_2d() [[
260
+ anno::display_name("Detail Normal Map"),
261
+ anno::in_group("Normal"),
262
+ anno::usage("normal")
263
+ ]],
264
+ uniform bool flip_tangent_u = false [[
265
+ anno::display_name("Normal Map Flip U Tangent"),
266
+ anno::in_group("Normal")
267
+ ]],
268
+ uniform bool flip_tangent_v = true [[
269
+ anno::display_name("Normal Map Flip V Tangent"),
270
+ anno::in_group("Normal")
271
+ ]],
272
+
273
+ // UVW Projection Group //
274
+
275
+ uniform bool project_uvw = false [[
276
+ anno::display_name("Enable Project UVW Coordinates"),
277
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
278
+ anno::in_group("UV")
279
+ ]],
280
+ uniform bool world_or_object = false [[
281
+ anno::display_name("Enable World Space"),
282
+ anno::description("When enabled, uses world space for projection, otherwise object space is used"),
283
+ anno::in_group("UV"),
284
+ anno::enable_if("project_uvw == true")
285
+ ]],
286
+ uniform int uv_space_index = 0 [[
287
+ anno::display_name("UV Space Index"),
288
+ anno::description("UV Space Index."),
289
+ anno::in_group("UV"),
290
+ anno::enable_if("project_uvw == true"),
291
+ anno::hard_range(int(0), int(3))
292
+ ]],
293
+
294
+ // UVW Adjustments Group //
295
+
296
+ uniform float2 texture_translate = float2(0.0) [[
297
+ anno::display_name("Texture Translate"),
298
+ anno::description("Controls position of texture."),
299
+ anno::in_group("UV"),
300
+ anno::enable_if("project_uvw == true")
301
+ ]],
302
+ uniform float texture_rotate = float(0.0) [[
303
+ anno::display_name("Texture Rotate"),
304
+ anno::description("Rotates angle of texture in degrees."),
305
+ anno::in_group("UV"),
306
+ anno::enable_if("project_uvw == true")
307
+ ]],
308
+ uniform float2 texture_scale = float2(1.0) [[
309
+ anno::display_name("Texture Tiling"),
310
+ anno::description("Controls the repetition of the texture."),
311
+ anno::in_group("UV"),
312
+ anno::enable_if("project_uvw == true")
313
+ ]],
314
+ uniform float2 detail_texture_translate = float2(0.0) [[
315
+ anno::display_name("Detail Texture Translate"),
316
+ anno::description("Controls the position of the detail texture."),
317
+ anno::in_group("UV"),
318
+ anno::enable_if("project_uvw == true")
319
+ ]],
320
+ uniform float detail_texture_rotate = float(0.0) [[
321
+ anno::display_name("Detail Texture Rotate"),
322
+ anno::description("Rotates angle of the detail texture in degrees."),
323
+ anno::in_group("UV"),
324
+ anno::enable_if("project_uvw == true")
325
+ ]],
326
+ uniform float2 detail_texture_scale = float2(1.0) [[
327
+ anno::display_name("Detail Texture Tiling"),
328
+ anno::description("Controls the repetition of the detail texture."),
329
+ anno::in_group("UV"),
330
+ anno::enable_if("project_uvw == true")
331
+ ]]
332
+ )
333
+ [[
334
+ anno::display_name("OmniPBR"),
335
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
336
+ anno::in_group("Base"),
337
+ anno::version( 2, 1, 2),
338
+ anno::author("NVIDIA CORPORATION"),
339
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
340
+ ]] = let {
341
+
342
+ material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat(
343
+ diffuse_color_constant: diffuse_color_constant,
344
+ diffuse_texture: diffuse_texture,
345
+ albedo_desaturation: albedo_desaturation,
346
+ albedo_add: albedo_add,
347
+ albedo_brightness: albedo_brightness,
348
+ diffuse_tint: diffuse_tint,
349
+ reflection_roughness_constant: reflection_roughness_constant,
350
+ reflection_roughness_texture_influence: reflection_roughness_texture_influence,
351
+ reflectionroughness_texture: reflectionroughness_texture,
352
+ metallic_constant: metallic_constant,
353
+ metallic_texture_influence: metallic_texture_influence,
354
+ metallic_texture: metallic_texture,
355
+ specular_level: specular_level,
356
+ enable_ORM_texture: enable_ORM_texture,
357
+ ORM_texture: ORM_texture,
358
+ ao_to_diffuse: ao_to_diffuse,
359
+ ao_texture: ao_texture,
360
+ enable_emission: enable_emission,
361
+ emissive_color: emissive_color,
362
+ emissive_color_texture: emissive_color_texture,
363
+ emissive_mask_texture: emissive_mask_texture,
364
+ emissive_intensity: emissive_intensity,
365
+ enable_opacity: enable_opacity,
366
+ opacity_texture: opacity_texture,
367
+ opacity_constant: opacity_constant,
368
+ enable_opacity_texture: enable_opacity_texture,
369
+ opacity_mode: opacity_mode,
370
+ opacity_threshold: opacity_threshold,
371
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
372
+ bump_factor: bump_factor,
373
+ normalmap_texture: normalmap_texture,
374
+ detail_bump_factor: detail_bump_factor,
375
+ detail_normalmap_texture: detail_normalmap_texture,
376
+ flip_tangent_u: flip_tangent_u,
377
+ flip_tangent_v: flip_tangent_v,
378
+ project_uvw: project_uvw,
379
+ world_or_object: world_or_object,
380
+ uv_space_index: uv_space_index,
381
+ texture_translate: texture_translate,
382
+ texture_rotate: texture_rotate,
383
+ texture_scale: texture_scale,
384
+ detail_texture_translate: detail_texture_translate,
385
+ detail_texture_rotate: detail_texture_rotate,
386
+ detail_texture_scale: detail_texture_scale
387
+ );
388
+
389
+ } in material(
390
+ surface: base.surface,
391
+ geometry: base.geometry
392
+ );
saved/assets/_dependencies/public_validation/materials/OmniGlass.mdl ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.4;
30
+ import ::anno::*;
31
+ import ::base::*;
32
+
33
+ using OmniGlass_Opacity import OmniGlass_Opacity;
34
+ export annotation distill_off();
35
+
36
+ export material OmniGlass(
37
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
38
+ [[
39
+ anno::hidden(),
40
+ anno::unused()
41
+ ]],
42
+ uniform bool use_glass_color_texture = false
43
+ [[
44
+ anno::hidden(),
45
+ anno::unused()
46
+ ]],
47
+ uniform color glass_color = color(1.f, 1.f, 1.f) [[
48
+ anno::display_name("Glass Color"),
49
+ anno::description("Sets the color of the glass"),
50
+ anno::hard_range(color(0.0), color(1.0)),
51
+ anno::in_group("Color")
52
+ ]],
53
+ uniform texture_2d glass_color_texture = texture_2d() [[
54
+ anno::display_name("Glass Color Texture"),
55
+ anno::description("Specifies the texture to be used for the glass color of the material"),
56
+ anno::in_group("Color")
57
+ ]],
58
+ float frosting_roughness = 0.f [[
59
+ anno::display_name("Glass Roughness"),
60
+ anno::description("Sets the roughness of the glass material "),
61
+ anno::hard_range(0.0, 1.0),
62
+ anno::in_group("Roughness")
63
+ ]],
64
+ uniform float glass_ior = 1.491f [[
65
+ anno::display_name("Glass IOR"),
66
+ anno::description("Sets IOR of the glass material "),
67
+ anno::soft_range(1.0f, 4.0f),
68
+ anno::in_group("Refraction")
69
+ ]],
70
+ uniform bool thin_walled = false [[
71
+ anno::display_name("Thin Walled"),
72
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
73
+ anno::in_group("Refraction")
74
+ ]],
75
+
76
+ // NEW PARAMETERS
77
+ uniform float depth = 0.001f [[
78
+ anno::description("Controls how much light is absorbed through the surface"),
79
+ anno::display_name("Volume Absorption Scale"),
80
+ anno::in_group("Color"),
81
+ anno::soft_range(0.f, 1.f),
82
+ anno::hard_range(0.f, 1000.f)
83
+ ]],
84
+ float roughness_texture_influence = 1.f [[
85
+ anno::display_name("Roughness Texture Influence"),
86
+ anno::in_group("Roughness"),
87
+ anno::hard_range(0.0f, 1.0f)
88
+ ]],
89
+ uniform texture_2d roughness_texture = texture_2d() [[
90
+ anno::description("The roughness texture"),
91
+ anno::display_name("Roughness Texture"),
92
+ anno::in_group("Roughness"),
93
+ anno::usage("roughness")
94
+ ]],
95
+ uniform texture_2d reflection_color_texture = texture_2d() [[
96
+ anno::description("The reflection color texture"),
97
+ anno::display_name("Reflection Color Texture"),
98
+ anno::in_group("Reflection")
99
+ ]],
100
+ uniform color reflection_color = color(1.f, 1.f, 1.f) [[
101
+ anno::display_name("Reflection Color"),
102
+ anno::in_group("Reflection")
103
+ ]],
104
+ uniform texture_2d normal_map_texture = texture_2d() [[
105
+ anno::description("The normal map texture"),
106
+ anno::display_name("Normal Map Texture"),
107
+ anno::in_group("Normal"),
108
+ anno::usage("normal")
109
+ ]],
110
+ uniform float normal_map_strength = 1.0 [[
111
+ anno::description("Determines the degree of bumpiness"),
112
+ anno::display_name("Normal Map Strength"),
113
+ anno::in_group("Normal"),
114
+ anno::usage(""),
115
+ anno::soft_range(0.f, 1.f)
116
+ ]],
117
+ uniform bool flip_tangent_u = false [[
118
+ anno::display_name("Normal Map Flip U Tangent"),
119
+ anno::in_group("Normal")
120
+ ]],
121
+ uniform bool flip_tangent_v = true [[
122
+ anno::display_name("Normal Map Flip V Tangent"),
123
+ anno::in_group("Normal")
124
+ ]],
125
+
126
+ // Cutout Opacity
127
+ uniform bool enable_opacity = false
128
+ [[
129
+ anno::display_name("Enable Opacity"),
130
+ anno::description("Enables the use of cutout opacity"),
131
+ anno::in_group("Opacity")
132
+ ]],
133
+ uniform float cutout_opacity = 1.0f [[
134
+ anno::hard_range(0.0, 1.0),
135
+ anno::display_name("Opacity Amount"),
136
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
137
+ anno::in_group("Opacity")
138
+ ]],
139
+ uniform texture_2d cutout_opacity_texture = texture_2d() [[
140
+ anno::description("The opacity map"),
141
+ anno::display_name("Opacity Map"),
142
+ anno::in_group("Opacity"),
143
+ anno::usage("opacity")
144
+ ]],
145
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha [[
146
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
147
+ anno::display_name("Opacity Mono Source"),
148
+ anno::in_group("Opacity"),
149
+ anno::usage("")
150
+ ]],
151
+ uniform float opacity_threshold = 0.f
152
+ [[
153
+ anno::hard_range(0.0, 1.0),
154
+ anno::display_name("Opacity Threshold"),
155
+ 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"),
156
+ anno::in_group("Opacity")
157
+ ]],
158
+
159
+ //
160
+ // End of new
161
+ //
162
+ // UV Projection Group
163
+ //
164
+ uniform bool project_uvw = false
165
+ [[
166
+ anno::display_name("Enable Project UVW Coordinates"),
167
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
168
+ anno::in_group("UV")
169
+ ]],
170
+ uniform bool world_or_object = false
171
+ [[
172
+ anno::display_name("Enable World Space"),
173
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
174
+ anno::in_group("UV")
175
+ ]],
176
+
177
+ // UV Space selector
178
+ uniform int uv_space_index = 0
179
+ [[
180
+ anno::display_name("UV Space Index"),
181
+ anno::description("Choose the UV Space Index to be used"),
182
+ anno::in_group("UV"),
183
+ anno::hard_range(0, 3)
184
+ ]],
185
+ uniform float2 texture_translate = float2(0.0f)
186
+ [[
187
+ anno::display_name("Texture Translate"),
188
+ anno::description("Controls the position of the texture."),
189
+ anno::in_group("UV")
190
+ ]],
191
+ uniform float texture_rotate = 0.f
192
+ [[
193
+ anno::display_name("Texture Rotate"),
194
+ anno::description("Rotates angle of the texture in degrees."),
195
+ anno::in_group("UV")
196
+ ]],
197
+ uniform float2 texture_scale = float2(1.0f)
198
+ [[
199
+ anno::display_name("Texture Tiling"),
200
+ anno::description("Controls repetition of the texture."),
201
+ anno::in_group("UV")
202
+ ]])
203
+ [[
204
+ anno::author("NVIDIA CORPORATION"),
205
+ anno::display_name("Omni Glass"),
206
+ anno::version( 1, 0, 0),
207
+ anno::in_group("Base"),
208
+ anno::description("Omni Glass Material V2"),
209
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
210
+ distill_off()
211
+ ]]
212
+ = OmniGlass_Opacity(
213
+ glass_color: glass_color,
214
+ glass_color_texture: glass_color_texture,
215
+ frosting_roughness: frosting_roughness,
216
+ glass_ior: glass_ior,
217
+ thin_walled: thin_walled,
218
+ depth: depth,
219
+ roughness_texture_influence: roughness_texture_influence,
220
+ roughness_texture: roughness_texture,
221
+ reflection_color_texture: reflection_color_texture,
222
+ reflection_color: reflection_color,
223
+ normal_map_texture: normal_map_texture,
224
+ normal_map_strength: normal_map_strength,
225
+ flip_tangent_u: flip_tangent_u,
226
+ flip_tangent_v: flip_tangent_v,
227
+ enable_opacity: enable_opacity,
228
+ cutout_opacity: cutout_opacity,
229
+ cutout_opacity_texture: cutout_opacity_texture,
230
+ cutout_opacity_mono_source: cutout_opacity_mono_source,
231
+ opacity_threshold: opacity_threshold,
232
+ project_uvw: project_uvw,
233
+ world_or_object: world_or_object,
234
+ uv_space_index: uv_space_index,
235
+ texture_translate: texture_translate,
236
+ texture_rotate: texture_rotate,
237
+ texture_scale: texture_scale
238
+ );
saved/assets/_dependencies/public_validation/materials/OmniGlass_1.mdl ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.4;
30
+ import ::anno::*;
31
+ import ::base::*;
32
+
33
+ using OmniGlass_Opacity_1 import OmniGlass_Opacity;
34
+ export annotation distill_off();
35
+
36
+
37
+ export material OmniGlass
38
+ (
39
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
40
+ [[
41
+ anno::hidden(),
42
+ anno::unused()
43
+ ]],
44
+ uniform bool use_glass_color_texture = false
45
+ [[
46
+ anno::hidden(),
47
+ anno::unused()
48
+ ]],
49
+ uniform color glass_color = color(1.f, 1.f, 1.f)
50
+ [[
51
+ anno::display_name("Glass Color"),
52
+ anno::description("Sets the color of the glass"),
53
+ anno::hard_range(color(0.0), color(1.0)),
54
+ anno::in_group("Color")
55
+ ]],
56
+ uniform texture_2d glass_color_texture = texture_2d()
57
+ [[
58
+ anno::display_name("Glass Color Texture"),
59
+ anno::description("Specifies the texture to be used for the glass color of the material"),
60
+ anno::in_group("Color")
61
+ ]],
62
+ float frosting_roughness = 0.f
63
+ [[
64
+ anno::display_name("Glass Roughness"),
65
+ anno::description("Sets the roughness of the glass material "),
66
+ anno::hard_range(0.0, 1.0),
67
+ anno::in_group("Roughness")
68
+ ]],
69
+ uniform float glass_ior = 1.491f
70
+ [[
71
+ anno::display_name("Glass IOR"),
72
+ anno::description("Sets IOR of the glass material "),
73
+ anno::soft_range(1.0f, 4.0f),
74
+ anno::in_group("Refraction")
75
+ ]],
76
+ uniform bool thin_walled = false
77
+ [[
78
+ anno::display_name("Thin Walled"),
79
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
80
+ anno::in_group("Refraction")
81
+ ]],
82
+ uniform float depth = 0.001f
83
+ [[
84
+ anno::description("Controls how much light is absorbed through the surface"),
85
+ anno::display_name("Volume Absorption Scale"),
86
+ anno::in_group("Color"),
87
+ anno::soft_range(0.f, 1.f),
88
+ anno::hard_range(0.f, 1000.f)
89
+ ]],
90
+ float roughness_texture_influence = 1.f
91
+ [[
92
+ anno::display_name("Roughness Texture Influence"),
93
+ anno::in_group("Roughness"),
94
+ anno::hard_range(0.0f, 1.0f)
95
+ ]],
96
+ uniform texture_2d roughness_texture = texture_2d()
97
+ [[
98
+ anno::description("The roughness texture"),
99
+ anno::display_name("Roughness Texture"),
100
+ anno::in_group("Roughness"),
101
+ anno::usage("roughness")
102
+ ]],
103
+ uniform texture_2d reflection_color_texture = texture_2d()
104
+ [[
105
+ anno::description("The reflection color texture"),
106
+ anno::display_name("Reflection Color Texture"),
107
+ anno::in_group("Reflection")
108
+ ]],
109
+ uniform color reflection_color = color(1.f, 1.f, 1.f)
110
+ [[
111
+ anno::display_name("Reflection Color"),
112
+ anno::in_group("Reflection")
113
+ ]],
114
+ uniform texture_2d normal_map_texture = texture_2d()
115
+ [[
116
+ anno::description("The normal map texture"),
117
+ anno::display_name("Normal Map Texture"),
118
+ anno::in_group("Normal"),
119
+ anno::usage("normal")
120
+ ]],
121
+ uniform float normal_map_strength = 1.0
122
+ [[
123
+ anno::description("Determines the degree of bumpiness"),
124
+ anno::display_name("Normal Map Strength"),
125
+ anno::in_group("Normal"),
126
+ anno::usage(""),
127
+ anno::soft_range(0.f, 1.f)
128
+ ]],
129
+ uniform float geometry_normal_roughness_strength = 1.f
130
+ [[
131
+ anno::hard_range(0.f, 1.f),
132
+ anno::display_name("Normal map to roughness weight"),
133
+ anno::description("Enables and weights roughness induced by normal maps"),
134
+ anno::in_group("Normal")
135
+ ]],
136
+ uniform bool flip_tangent_u = false
137
+ [[
138
+ anno::display_name("Normal Map Flip U Tangent"),
139
+ anno::in_group("Normal")
140
+ ]],
141
+ uniform bool flip_tangent_v = true
142
+ [[
143
+ anno::display_name("Normal Map Flip V Tangent"),
144
+ anno::in_group("Normal")
145
+ ]],
146
+
147
+ // Cutout Opacity
148
+ uniform bool enable_opacity = false
149
+ [[
150
+ anno::display_name("Enable Opacity"),
151
+ anno::description("Enables the use of cutout opacity"),
152
+ anno::in_group("Opacity")
153
+ ]],
154
+ uniform float cutout_opacity = 1.0f
155
+ [[
156
+ anno::hard_range(0.0, 1.0),
157
+ anno::display_name("Opacity Amount"),
158
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
159
+ anno::in_group("Opacity")
160
+ ]],
161
+ uniform texture_2d cutout_opacity_texture = texture_2d()
162
+ [[
163
+ anno::description("The opacity map"),
164
+ anno::display_name("Opacity Map"),
165
+ anno::in_group("Opacity"),
166
+ anno::usage("opacity")
167
+ ]],
168
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha
169
+ [[
170
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
171
+ anno::display_name("Opacity Mono Source"),
172
+ anno::in_group("Opacity"),
173
+ anno::usage("")
174
+ ]],
175
+ uniform float opacity_threshold = 0.f
176
+ [[
177
+ anno::hard_range(0.0, 1.0),
178
+ anno::display_name("Opacity Threshold"),
179
+ 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"),
180
+ anno::in_group("Opacity")
181
+ ]],
182
+
183
+ // UV Projection Group
184
+ uniform bool project_uvw = false
185
+ [[
186
+ anno::display_name("Enable Project UVW Coordinates"),
187
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
188
+ anno::in_group("UV")
189
+ ]],
190
+ uniform bool world_or_object = false
191
+ [[
192
+ anno::display_name("Enable World Space"),
193
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
194
+ anno::in_group("UV")
195
+ ]],
196
+
197
+ // UV Space Selector
198
+ uniform int uv_space_index = 0
199
+ [[
200
+ anno::display_name("UV Space Index"),
201
+ anno::description("Choose the UV Space Index to be used"),
202
+ anno::in_group("UV"),
203
+ anno::hard_range(0, 3)
204
+ ]],
205
+ uniform float2 texture_translate = float2(0.0f)
206
+ [[
207
+ anno::display_name("Texture Translate"),
208
+ anno::description("Controls the position of the texture."),
209
+ anno::in_group("UV")
210
+ ]],
211
+ uniform float texture_rotate = 0.f
212
+ [[
213
+ anno::display_name("Texture Rotate"),
214
+ anno::description("Rotates angle of the texture in degrees."),
215
+ anno::in_group("UV")
216
+ ]],
217
+ uniform float2 texture_scale = float2(1.0f)
218
+ [[
219
+ anno::display_name("Texture Tiling"),
220
+ anno::description("Controls repetition of the texture."),
221
+ anno::in_group("UV")
222
+ ]]
223
+ )
224
+ [[
225
+ anno::author("NVIDIA CORPORATION"),
226
+ anno::display_name("Omni Glass"),
227
+ anno::version( 1, 0, 0),
228
+ anno::in_group("Base"),
229
+ anno::description("Omni Glass Material V2"),
230
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
231
+ distill_off()
232
+ ]]
233
+ = OmniGlass_Opacity(
234
+ glass_color: glass_color,
235
+ glass_color_texture: glass_color_texture,
236
+ frosting_roughness: frosting_roughness,
237
+ glass_ior: glass_ior,
238
+ thin_walled: thin_walled,
239
+ depth: depth,
240
+ roughness_texture_influence: roughness_texture_influence,
241
+ roughness_texture: roughness_texture,
242
+ reflection_color_texture: reflection_color_texture,
243
+ reflection_color: reflection_color,
244
+ normal_map_texture: normal_map_texture,
245
+ normal_map_strength: normal_map_strength,
246
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
247
+ flip_tangent_u: flip_tangent_u,
248
+ flip_tangent_v: flip_tangent_v,
249
+ enable_opacity: enable_opacity,
250
+ cutout_opacity: cutout_opacity,
251
+ cutout_opacity_texture: cutout_opacity_texture,
252
+ cutout_opacity_mono_source: cutout_opacity_mono_source,
253
+ opacity_threshold: opacity_threshold,
254
+ project_uvw: project_uvw,
255
+ world_or_object: world_or_object,
256
+ uv_space_index: uv_space_index,
257
+ texture_translate: texture_translate,
258
+ texture_rotate: texture_rotate,
259
+ texture_scale: texture_scale
260
+ );
saved/assets/_dependencies/public_validation/materials/OmniGlass_Opacity.mdl ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+
30
+ mdl 1.4;
31
+
32
+ import ::tex::*;
33
+ import ::base::*;
34
+ import ::math::*;
35
+ import ::anno::*;
36
+ import ::df::*;
37
+ import ::state::*;
38
+
39
+ const string COPYRIGHT =
40
+ " Copyright 1986, 2020 NVIDIA Corporation. All rights reserved.\n"
41
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
42
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
43
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
44
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
45
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
46
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
47
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
48
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
49
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
50
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
51
+
52
+ float get_float( uniform texture_2d t,
53
+ float f,
54
+ base::texture_coordinate_info uvw,
55
+ uniform base::mono_mode mono_source = base::mono_maximum)
56
+ {
57
+ return tex::texture_isvalid(t)
58
+ ?
59
+ base::file_texture(t,
60
+ color(0.f, 0.f, 0.f),
61
+ color(1.f, 1.f, 1.f),
62
+ mono_source,
63
+ uvw,
64
+ float2(0.f, 1.f),
65
+ float2(0.f, 1.f),
66
+ tex::wrap_repeat,
67
+ tex::wrap_repeat,
68
+ false).mono
69
+ :
70
+ f;
71
+ }
72
+
73
+ color get_color( uniform texture_2d t,
74
+ color c,
75
+ base::texture_coordinate_info uvw)
76
+ {
77
+ return tex::texture_isvalid(t)
78
+ ?
79
+ base::file_texture(t,
80
+ color(0.f, 0.f, 0.f),
81
+ color(1.f, 1.f, 1.f),
82
+ base::mono_alpha,
83
+ uvw,
84
+ float2(0.f, 1.f),
85
+ float2(0.f, 1.f),
86
+ tex::wrap_repeat,
87
+ tex::wrap_repeat,
88
+ false).tint
89
+ :
90
+ c;
91
+ }
92
+
93
+ float apply_roughness_influence(
94
+ uniform texture_2d roughness_texture,
95
+ float constant_roughness,
96
+ float roughness_influence,
97
+ base::texture_coordinate_info uvw){
98
+ return math::lerp(constant_roughness, get_float(roughness_texture, constant_roughness, uvw), roughness_influence);
99
+ }
100
+
101
+ color get_volume_absorption(
102
+ float absorption = float(0.001f) [[
103
+ anno::display_name("Volume Absorption"),
104
+ anno::description("Controls how much light is absorbed through the surface"),
105
+ anno::hard_range(0.0,1000.0),
106
+ anno::soft_range(0.0,1.0)
107
+ ]],
108
+
109
+ color absorptionColor = color(1) [[
110
+ anno::display_name("Absorption Color"),
111
+ anno::description("Simulates shifts in color when light passes through the surface")
112
+ ]]
113
+ ) [[
114
+ anno::display_name("Absorption"),
115
+ anno::description("Provides an absorption coefficient for the volume"),
116
+ anno::unused()
117
+ ]] {
118
+ return (absorption > 0) ?
119
+ -math::log(math::clamp(absorptionColor, color(0), color(1))) * absorption * 100.0 :
120
+ color(0);
121
+ }
122
+
123
+ uniform float4x4 rotation_translation_scale(
124
+ uniform float3 rotation = float3(0.)
125
+ [[ anno::description("Rotation applied to every UVW coordinate") ]],
126
+ uniform float3 translation = float3(0.)
127
+ [[ anno::description("Offset applied to every UVW coordinate") ]],
128
+ uniform float3 scaling = float3(1.)
129
+ [[ anno::description("Scale applied to every UVW coordinate") ]]
130
+ )
131
+ [[
132
+ anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
133
+ anno::hidden()
134
+ ]]
135
+ {
136
+ float4x4 scale =
137
+ float4x4(scaling.x , 0. , 0. , 0.,
138
+ 0. , scaling.y , 0. , 0.,
139
+ 0. , 0. , scaling.z , 0.,
140
+ translation.x, translation.y, translation.z, 1.);
141
+
142
+ float3 s = math::sin(rotation);
143
+ float3 c = math::cos(rotation);
144
+ float4x4 rotate =
145
+ 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,
146
+ 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,
147
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
148
+ 0. , 0 , 0 , 1.);
149
+
150
+ return scale*rotate;
151
+ }
152
+
153
+
154
+
155
+
156
+
157
+ export annotation distill_off();
158
+
159
+ export material OmniGlass_Opacity(
160
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
161
+ [[
162
+ anno::hidden(),
163
+ anno::unused()
164
+ ]],
165
+ uniform bool use_glass_color_texture = false
166
+ [[
167
+ anno::hidden(),
168
+ anno::unused()
169
+ ]],
170
+ uniform color glass_color = color(1.f, 1.f, 1.f) [[
171
+ anno::display_name("Glass Color"),
172
+ anno::description("Sets the color of the glass"),
173
+ anno::hard_range(color(0.0), color(1.0)),
174
+ anno::in_group("Color")
175
+ ]],
176
+ uniform texture_2d glass_color_texture = texture_2d() [[
177
+ anno::display_name("Glass Color Texture"),
178
+ anno::description("Specifies the texture to be used for the glass color of the material"),
179
+ anno::in_group("Color")
180
+ ]],
181
+ float frosting_roughness = 0.f [[
182
+ anno::display_name("Glass Roughness"),
183
+ anno::description("Sets the roughness of the glass material "),
184
+ anno::hard_range(0.0, 1.0),
185
+ anno::in_group("Roughness")
186
+ ]],
187
+ uniform float glass_ior = 1.491f [[
188
+ anno::display_name("Glass IOR"),
189
+ anno::description("Sets IOR of the glass material "),
190
+ anno::soft_range(1.0f, 4.0f),
191
+ anno::in_group("Refraction")
192
+ ]],
193
+ uniform bool thin_walled = false [[
194
+ anno::display_name("Thin Walled"),
195
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
196
+ anno::in_group("Refraction")
197
+ ]],
198
+
199
+
200
+ // NEW PARAMETERS
201
+ uniform float depth = 0.001f [[
202
+ anno::description("Controls how much light is absorbed through the surface"),
203
+ anno::display_name("Volume Absorption Scale"),
204
+ anno::in_group("Color"),
205
+ anno::soft_range(0.f, 1.f),
206
+ anno::hard_range(0.f, 1000.f)
207
+ ]],
208
+ float roughness_texture_influence = 1.f [[
209
+ anno::display_name("Roughness Texture Influence"),
210
+ anno::in_group("Roughness"),
211
+ anno::hard_range(0.0f, 1.0f)
212
+ ]],
213
+ uniform texture_2d roughness_texture = texture_2d() [[
214
+ anno::description("The roughness texture"),
215
+ anno::display_name("Roughness Texture"),
216
+ anno::in_group("Roughness"),
217
+ anno::usage("")
218
+ ]],
219
+ uniform texture_2d reflection_color_texture = texture_2d() [[
220
+ anno::description("The reflection color texture"),
221
+ anno::display_name("Reflection Color Texture"),
222
+ anno::in_group("Reflection")
223
+ ]],
224
+ uniform color reflection_color = color(1.f, 1.f, 1.f) [[
225
+ anno::display_name("Reflection Color"),
226
+ anno::in_group("Reflection")
227
+ ]],
228
+ uniform texture_2d normal_map_texture = texture_2d() [[
229
+ anno::description("The normal map texture"),
230
+ anno::display_name("Normal Map Texture"),
231
+ anno::in_group("Normal"),
232
+ anno::usage("")
233
+ ]],
234
+ uniform float normal_map_strength = 1.0 [[
235
+ anno::description("Determines the degree of bumpiness"),
236
+ anno::display_name("Normal Map Strength"),
237
+ anno::in_group("Normal"),
238
+ anno::usage(""),
239
+ anno::soft_range(0.f, 1.f)
240
+ ]],
241
+ uniform bool flip_tangent_u = false [[
242
+ anno::display_name("Normal Map Flip U Tangent"),
243
+ anno::in_group("Normal")
244
+ ]],
245
+ uniform bool flip_tangent_v = true [[
246
+ anno::display_name("Normal Map Flip V Tangent"),
247
+ anno::in_group("Normal")
248
+ ]],
249
+
250
+ // Cutout Opacity
251
+ uniform bool enable_opacity = true
252
+ [[
253
+ anno::display_name("Enable Opacity"),
254
+ anno::description("Enables the use of cutout opacity"),
255
+ anno::in_group("Opacity")
256
+ ]],
257
+ uniform float cutout_opacity = 1.0f [[
258
+ anno::hard_range(0.0, 1.0),
259
+ anno::display_name("Opacity Amount"),
260
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
261
+ anno::in_group("Opacity")
262
+ ]],
263
+ uniform texture_2d cutout_opacity_texture = texture_2d() [[
264
+ anno::description("The opacity map"),
265
+ anno::display_name("Opacity Map"),
266
+ anno::in_group("Opacity")
267
+ ]],
268
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha [[
269
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
270
+ anno::display_name("Opacity Mono Source"),
271
+ anno::in_group("Opacity"),
272
+ anno::usage("")
273
+ ]],
274
+ uniform float opacity_threshold = 0.f
275
+ [[
276
+ anno::hard_range(0.0, 1.0),
277
+ anno::display_name("Opacity Threshold"),
278
+ 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"),
279
+ anno::in_group("Opacity")
280
+ ]],
281
+
282
+ //
283
+ // End of new
284
+ //
285
+ // UV Projection Group
286
+ //
287
+ uniform bool project_uvw = false
288
+ [[
289
+ anno::display_name("Enable Project UVW Coordinates"),
290
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
291
+ anno::in_group("UV")
292
+ ]],
293
+ uniform bool world_or_object = false
294
+ [[
295
+ anno::display_name("Enable World Space"),
296
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
297
+ anno::in_group("UV")
298
+ ]],
299
+
300
+ // UV Space selector
301
+ uniform int uv_space_index = 0
302
+ [[
303
+ anno::display_name("UV Space Index"),
304
+ anno::description("Choose the UV Space Index to be used"),
305
+ anno::in_group("UV"),
306
+ anno::hard_range(0, 3)
307
+ ]],
308
+ uniform float2 texture_translate = float2(0.0f)
309
+ [[
310
+ anno::display_name("Texture Translate"),
311
+ anno::description("Controls the position of the texture."),
312
+ anno::in_group("UV")
313
+ ]],
314
+ uniform float texture_rotate = 0.f
315
+ [[
316
+ anno::display_name("Texture Rotate"),
317
+ anno::description("Rotates angle of the texture in degrees."),
318
+ anno::in_group("UV")
319
+ ]],
320
+ uniform float2 texture_scale = float2(1.0f)
321
+ [[
322
+ anno::display_name("Texture Scale"),
323
+ anno::description("Larger numbers increase the size."),
324
+ anno::in_group("UV")
325
+ ]])
326
+ [[
327
+ anno::copyright_notice(COPYRIGHT),
328
+ anno::author("NVIDIA CORPORATION"),
329
+ anno::display_name("Omni Glass Opacity"),
330
+ anno::version( 1, 0, 0),
331
+ anno::description("Omni Glass Opacity Material"),
332
+ anno::in_group("Base"),
333
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
334
+ distill_off()
335
+ ]]
336
+ =
337
+ let {
338
+ /* Material Properties */
339
+
340
+ bool local_thin_walled = (tex::texture_isvalid(cutout_opacity_texture) || cutout_opacity != 1.f) ?
341
+ true : thin_walled;
342
+
343
+ color local_glass_ior = glass_ior;
344
+
345
+ /* UVW Properties */
346
+ // Generating the texture coordinates for the texture lookups
347
+ base::texture_coordinate_system the_system = world_or_object ?
348
+ base::texture_coordinate_world :
349
+ base::texture_coordinate_object;
350
+
351
+
352
+ base::texture_coordinate_info uvw = project_uvw ?
353
+ base::coordinate_projection(
354
+ coordinate_system: the_system,
355
+ texture_space: uv_space_index,
356
+ projection_type: base::projection_cubic ) :
357
+ base::coordinate_source(
358
+ coordinate_system: base::texture_coordinate_uvw,
359
+ texture_space: uv_space_index
360
+ );
361
+
362
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
363
+ transform: rotation_translation_scale(
364
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
365
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
366
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
367
+ ),
368
+ coordinate: uvw
369
+ );
370
+ float opacity_value = get_float(
371
+ cutout_opacity_texture,
372
+ cutout_opacity,
373
+ transformed_uvw,
374
+ cutout_opacity_mono_source
375
+ );
376
+
377
+ // The opacity_threshold is interpreted as follows:
378
+ // 1. opacity_threshold > 0: binary opacity masking mode
379
+ // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0
380
+ // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched,
381
+ // allowing the renderer to use fractional cutout_opacity values, if it supports this feature
382
+ //
383
+ // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets
384
+ // cutout_opacity values of 1.0 as opaque and anything below as fully transparent
385
+ float local_cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
386
+
387
+ color local_reflection_color = get_color(
388
+ reflection_color_texture,
389
+ reflection_color,
390
+ transformed_uvw
391
+ );
392
+
393
+ color local_transmission_color = get_color(
394
+ glass_color_texture,
395
+ glass_color,
396
+ transformed_uvw
397
+ );
398
+
399
+ /* Surface Properties */
400
+ float local_roughness = apply_roughness_influence(
401
+ roughness_texture,
402
+ frosting_roughness,
403
+ roughness_texture_influence,
404
+ transformed_uvw
405
+ );
406
+
407
+ float local_roughness_squared = local_roughness * local_roughness;
408
+ bsdf ggx_1 = ::df::microfacet_ggx_smith_bsdf(
409
+ local_roughness_squared,
410
+ local_roughness_squared,
411
+ local_reflection_color,
412
+ ::state::texture_tangent_u(0),
413
+ ::df::scatter_reflect,
414
+ ""
415
+ );
416
+
417
+ bsdf ggx_2 = ::df::microfacet_ggx_smith_bsdf(
418
+ local_roughness_squared,
419
+ local_roughness_squared,
420
+ local_transmission_color,
421
+ ::state::texture_tangent_u(0),
422
+ ::df::scatter_transmit,
423
+ ""
424
+ );
425
+
426
+ material_surface local_surface(
427
+ ::df::fresnel_layer(
428
+ glass_ior,
429
+ 1.f,
430
+ ggx_1,
431
+ ggx_2,
432
+ normal: ::state::normal()
433
+ ),
434
+ material_emission()
435
+ );
436
+
437
+ /* Volume Properties */
438
+ color local_volume_absorption = depth;
439
+ color local_volume_scattering = color(0.f, 0.f, 0.f);
440
+ material_volume local_volume(
441
+ vdf(),
442
+ local_volume_absorption,
443
+ local_volume_scattering
444
+ );
445
+
446
+ // Normal calculations
447
+ float3 the_normal = tex::texture_isvalid(normal_map_texture) ?
448
+ base::tangent_space_normal_texture(
449
+ texture: normal_map_texture,
450
+ factor: normal_map_strength,
451
+ flip_tangent_u: flip_tangent_u,
452
+ flip_tangent_v: flip_tangent_v,
453
+ uvw: transformed_uvw
454
+ //flip_tangent_v: true
455
+ ): state::normal() ;
456
+
457
+ /* Geometry Properties */
458
+
459
+ material_geometry local_geometry(
460
+ float3(0.f),
461
+ local_cutout_opacity,
462
+ the_normal
463
+ );
464
+ /* material_geometry local_geometry(
465
+ float3(0.f),
466
+ local_cutout_opacity,
467
+ ::base::tangent_space_normal_texture(
468
+ normal_map_texture,
469
+ normal_map_strength,
470
+ false,
471
+ true, /*flip_tangent_v OM-22707*/
472
+ transformed_uvw,
473
+ float2(0.f, 1.f),
474
+ float2(0.f, 1.f),
475
+ ::tex::wrap_repeat,
476
+ ::tex::wrap_repeat,
477
+ false,
478
+ 1.f,
479
+ 0.f)
480
+ ); */
481
+
482
+ } in
483
+ material(
484
+ thin_walled: local_thin_walled,
485
+ surface: local_surface,
486
+ ior: local_glass_ior,
487
+ volume: local_volume,
488
+ geometry: local_geometry);
saved/assets/_dependencies/public_validation/materials/OmniGlass_Opacity_1.mdl ADDED
@@ -0,0 +1,487 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+
30
+ mdl 1.4;
31
+
32
+ import ::tex::*;
33
+ import ::base::*;
34
+ import ::math::*;
35
+ import ::anno::*;
36
+ import ::df::*;
37
+ import ::state::*;
38
+ import OmniPBRBase::*;
39
+
40
+ const string COPYRIGHT =
41
+ " Copyright 1986, 2020 NVIDIA Corporation. All rights reserved.\n"
42
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
43
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
44
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
45
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
46
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
47
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
48
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
49
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
50
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
51
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
52
+
53
+ export annotation distill_off();
54
+
55
+
56
+ float get_float(
57
+ uniform texture_2d t,
58
+ float f,
59
+ base::texture_coordinate_info uvw,
60
+ uniform base::mono_mode mono_source = base::mono_maximum
61
+ )
62
+ {
63
+ return tex::texture_isvalid(t) ?
64
+ base::file_texture(
65
+ t,
66
+ color(0.f, 0.f, 0.f),
67
+ color(1.f, 1.f, 1.f),
68
+ mono_source,
69
+ uvw,
70
+ float2(0.f, 1.f),
71
+ float2(0.f, 1.f),
72
+ tex::wrap_repeat,
73
+ tex::wrap_repeat,
74
+ false
75
+ ).mono :
76
+ f;
77
+ }
78
+
79
+ color get_color(
80
+ uniform texture_2d t,
81
+ color c,
82
+ base::texture_coordinate_info uvw
83
+ )
84
+ {
85
+ return tex::texture_isvalid(t) ?
86
+ base::file_texture(
87
+ t,
88
+ color(0.f, 0.f, 0.f),
89
+ color(1.f, 1.f, 1.f),
90
+ base::mono_alpha,
91
+ uvw,
92
+ float2(0.f, 1.f),
93
+ float2(0.f, 1.f),
94
+ tex::wrap_repeat,
95
+ tex::wrap_repeat,
96
+ false
97
+ ).tint :
98
+ c;
99
+ }
100
+
101
+ float apply_roughness_influence(
102
+ uniform texture_2d roughness_texture,
103
+ float constant_roughness,
104
+ float roughness_influence,
105
+ base::texture_coordinate_info uvw
106
+ )
107
+ {
108
+ return math::lerp(
109
+ constant_roughness,
110
+ get_float(roughness_texture, constant_roughness, uvw),
111
+ roughness_influence
112
+ );
113
+ }
114
+
115
+ uniform float4x4 rotation_translation_scale(
116
+ uniform float3 rotation = float3(0.)
117
+ [[
118
+ anno::description("Rotation applied to every UVW coordinate")
119
+ ]],
120
+ uniform float3 translation = float3(0.)
121
+ [[
122
+ anno::description("Offset applied to every UVW coordinate")
123
+ ]],
124
+ uniform float3 scaling = float3(1.)
125
+ [[
126
+ anno::description("Scale applied to every UVW coordinate")
127
+ ]]
128
+ )
129
+ [[
130
+ anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
131
+ anno::hidden()
132
+ ]]
133
+ {
134
+ float4x4 scale = float4x4(
135
+ scaling.x , 0. , 0. , 0.,
136
+ 0. , scaling.y , 0. , 0.,
137
+ 0. , 0. , scaling.z , 0.,
138
+ translation.x, translation.y, translation.z, 1.
139
+ );
140
+
141
+ float3 s = math::sin(rotation);
142
+ float3 c = math::cos(rotation);
143
+ float4x4 rotate = float4x4(
144
+ 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,
145
+ 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,
146
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
147
+ 0. , 0. , 0. , 1.
148
+ );
149
+
150
+ return scale*rotate;
151
+ }
152
+
153
+
154
+ export material OmniGlass_Opacity
155
+ (
156
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
157
+ [[
158
+ anno::hidden(),
159
+ anno::unused()
160
+ ]],
161
+ uniform bool use_glass_color_texture = false
162
+ [[
163
+ anno::hidden(),
164
+ anno::unused()
165
+ ]],
166
+ uniform color glass_color = color(1.f, 1.f, 1.f)
167
+ [[
168
+ anno::display_name("Glass Color"),
169
+ anno::description("Sets the color of the glass"),
170
+ anno::hard_range(color(0.0), color(1.0)),
171
+ anno::in_group("Color")
172
+ ]],
173
+ uniform texture_2d glass_color_texture = texture_2d()
174
+ [[
175
+ anno::display_name("Glass Color Texture"),
176
+ anno::description("Specifies the texture to be used for the glass color of the material"),
177
+ anno::in_group("Color")
178
+ ]],
179
+ float frosting_roughness = 0.f
180
+ [[
181
+ anno::display_name("Glass Roughness"),
182
+ anno::description("Sets the roughness of the glass material "),
183
+ anno::hard_range(0.0, 1.0),
184
+ anno::in_group("Roughness")
185
+ ]],
186
+ uniform float glass_ior = 1.491f
187
+ [[
188
+ anno::display_name("Glass IOR"),
189
+ anno::description("Sets IOR of the glass material "),
190
+ anno::soft_range(1.0f, 4.0f),
191
+ anno::in_group("Refraction")
192
+ ]],
193
+ uniform bool thin_walled = false
194
+ [[
195
+ anno::display_name("Thin Walled"),
196
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
197
+ anno::in_group("Refraction")
198
+ ]],
199
+ uniform float depth = 0.001f
200
+ [[
201
+ anno::description("Controls how much light is absorbed through the surface"),
202
+ anno::display_name("Volume Absorption Scale"),
203
+ anno::in_group("Color"),
204
+ anno::soft_range(0.f, 1.f),
205
+ anno::hard_range(0.f, 1000.f)
206
+ ]],
207
+ float roughness_texture_influence = 1.f
208
+ [[
209
+ anno::display_name("Roughness Texture Influence"),
210
+ anno::in_group("Roughness"),
211
+ anno::hard_range(0.0f, 1.0f)
212
+ ]],
213
+ uniform texture_2d roughness_texture = texture_2d()
214
+ [[
215
+ anno::description("The roughness texture"),
216
+ anno::display_name("Roughness Texture"),
217
+ anno::in_group("Roughness"),
218
+ anno::usage("")
219
+ ]],
220
+ uniform texture_2d reflection_color_texture = texture_2d()
221
+ [[
222
+ anno::description("The reflection color texture"),
223
+ anno::display_name("Reflection Color Texture"),
224
+ anno::in_group("Reflection")
225
+ ]],
226
+ uniform color reflection_color = color(1.f, 1.f, 1.f)
227
+ [[
228
+ anno::display_name("Reflection Color"),
229
+ anno::in_group("Reflection")
230
+ ]],
231
+ uniform texture_2d normal_map_texture = texture_2d()
232
+ [[
233
+ anno::description("The normal map texture"),
234
+ anno::display_name("Normal Map Texture"),
235
+ anno::in_group("Normal"),
236
+ anno::usage("")
237
+ ]],
238
+ uniform float normal_map_strength = 1.0
239
+ [[
240
+ anno::description("Determines the degree of bumpiness"),
241
+ anno::display_name("Normal Map Strength"),
242
+ anno::in_group("Normal"),
243
+ anno::usage(""),
244
+ anno::soft_range(0.f, 1.f)
245
+ ]],
246
+ uniform float geometry_normal_roughness_strength = 1.f
247
+ [[
248
+ anno::hard_range(0.f, 1.f),
249
+ anno::display_name("Normal map to roughness weight"),
250
+ anno::description("Enables and weights roughness induced by normal maps"),
251
+ anno::in_group("Normal")
252
+ ]],
253
+ uniform bool flip_tangent_u = false
254
+ [[
255
+ anno::display_name("Normal Map Flip U Tangent"),
256
+ anno::in_group("Normal")
257
+ ]],
258
+ uniform bool flip_tangent_v = true
259
+ [[
260
+ anno::display_name("Normal Map Flip V Tangent"),
261
+ anno::in_group("Normal")
262
+ ]],
263
+
264
+ // Cutout Opacity
265
+ uniform bool enable_opacity = true
266
+ [[
267
+ anno::display_name("Enable Opacity"),
268
+ anno::description("Enables the use of cutout opacity"),
269
+ anno::in_group("Opacity")
270
+ ]],
271
+ uniform float cutout_opacity = 1.0f
272
+ [[
273
+ anno::hard_range(0.0, 1.0),
274
+ anno::display_name("Opacity Amount"),
275
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
276
+ anno::in_group("Opacity")
277
+ ]],
278
+ uniform texture_2d cutout_opacity_texture = texture_2d()
279
+ [[
280
+ anno::description("The opacity map"),
281
+ anno::display_name("Opacity Map"),
282
+ anno::in_group("Opacity")
283
+ ]],
284
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha
285
+ [[
286
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
287
+ anno::display_name("Opacity Mono Source"),
288
+ anno::in_group("Opacity"),
289
+ anno::usage("")
290
+ ]],
291
+ uniform float opacity_threshold = 0.f
292
+ [[
293
+ anno::hard_range(0.0, 1.0),
294
+ anno::display_name("Opacity Threshold"),
295
+ 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"),
296
+ anno::in_group("Opacity")
297
+ ]],
298
+
299
+ // UV Projection Group
300
+ uniform bool project_uvw = false
301
+ [[
302
+ anno::display_name("Enable Project UVW Coordinates"),
303
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
304
+ anno::in_group("UV")
305
+ ]],
306
+ uniform bool world_or_object = false
307
+ [[
308
+ anno::display_name("Enable World Space"),
309
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
310
+ anno::in_group("UV")
311
+ ]],
312
+
313
+ // UV Space Selector
314
+ uniform int uv_space_index = 0
315
+ [[
316
+ anno::display_name("UV Space Index"),
317
+ anno::description("Choose the UV Space Index to be used"),
318
+ anno::in_group("UV"),
319
+ anno::hard_range(0, 3)
320
+ ]],
321
+ uniform float2 texture_translate = float2(0.0f)
322
+ [[
323
+ anno::display_name("Texture Translate"),
324
+ anno::description("Controls the position of the texture."),
325
+ anno::in_group("UV")
326
+ ]],
327
+ uniform float texture_rotate = 0.f
328
+ [[
329
+ anno::display_name("Texture Rotate"),
330
+ anno::description("Rotates angle of the texture in degrees."),
331
+ anno::in_group("UV")
332
+ ]],
333
+ uniform float2 texture_scale = float2(1.0f)
334
+ [[
335
+ anno::display_name("Texture Scale"),
336
+ anno::description("Larger numbers increase the size."),
337
+ anno::in_group("UV")
338
+ ]]
339
+ )
340
+ [[
341
+ anno::copyright_notice(COPYRIGHT),
342
+ anno::author("NVIDIA CORPORATION"),
343
+ anno::display_name("Omni Glass Opacity"),
344
+ anno::version( 1, 0, 0),
345
+ anno::description("Omni Glass Opacity Material"),
346
+ anno::in_group("Base"),
347
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
348
+ distill_off()
349
+ ]]
350
+ = let {
351
+ // Material Properties
352
+ bool local_thin_walled = (tex::texture_isvalid(cutout_opacity_texture) || cutout_opacity != 1.f) ? true : thin_walled;
353
+ color local_glass_ior = glass_ior;
354
+
355
+
356
+ // UVW Properties
357
+ // Generating the texture coordinates for the texture lookups
358
+ base::texture_coordinate_system the_system = world_or_object ?
359
+ base::texture_coordinate_world :
360
+ base::texture_coordinate_object;
361
+
362
+ base::texture_coordinate_info uvw = project_uvw ?
363
+ base::coordinate_projection(
364
+ coordinate_system: the_system,
365
+ texture_space: uv_space_index,
366
+ projection_type: base::projection_cubic
367
+ ) :
368
+ base::coordinate_source(
369
+ coordinate_system: base::texture_coordinate_uvw,
370
+ texture_space: uv_space_index
371
+ );
372
+
373
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
374
+ transform: rotation_translation_scale(
375
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
376
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI),
377
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
378
+ ),
379
+ coordinate: uvw
380
+ );
381
+
382
+
383
+ // Opacity Properties
384
+ float opacity_value = get_float(cutout_opacity_texture, cutout_opacity, transformed_uvw, cutout_opacity_mono_source);
385
+
386
+ // The opacity_threshold is interpreted as follows:
387
+ // 1. opacity_threshold > 0: binary opacity masking mode
388
+ // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0
389
+ // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched,
390
+ // allowing the renderer to use fractional cutout_opacity values, if it supports this feature
391
+ //
392
+ // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets
393
+ // cutout_opacity values of 1.0 as opaque and anything below as fully transparent
394
+ float local_cutout_opacity = enable_opacity ?
395
+ ((opacity_threshold == 0.0) ?
396
+ opacity_value :
397
+ ((opacity_value >= opacity_threshold) ? 1.0 : 0)
398
+ ) :
399
+ 1.0;
400
+
401
+
402
+ // Surface Properties
403
+ color local_reflection_color = get_color(reflection_color_texture, reflection_color, transformed_uvw);
404
+ color local_transmission_color = get_color(glass_color_texture, glass_color, transformed_uvw);
405
+
406
+ OmniPBRBase::NormalData defaultData(state::normal(), float2(0.f));
407
+ OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normal_map_texture) ?
408
+ OmniPBRBase::tangent_space_normal_roughness_texture(
409
+ normal_map_texture,
410
+ normal_map_strength,
411
+ flip_tangent_u,
412
+ flip_tangent_v,
413
+ transformed_uvw,
414
+ float2(0.f, 1.f),
415
+ float2(0.f, 1.f),
416
+ tex::wrap_repeat,
417
+ tex::wrap_repeat,
418
+ false,
419
+ 1.f,
420
+ 0.f,
421
+ 0.f,
422
+ int2(0),
423
+ tex::wrap_repeat,
424
+ 30.f
425
+ ) :
426
+ defaultData;
427
+
428
+ float local_roughness = apply_roughness_influence(
429
+ roughness_texture,
430
+ frosting_roughness,
431
+ roughness_texture_influence,
432
+ transformed_uvw
433
+ );
434
+ float2 local_roughness_squared(
435
+ (local_roughness * local_roughness +
436
+ geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x),
437
+ (local_roughness * local_roughness +
438
+ geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y)
439
+ );
440
+
441
+ float3 the_normal = normal_data.normal;
442
+
443
+ bsdf ggx_1 = ::df::microfacet_ggx_smith_bsdf(
444
+ roughness_u: local_roughness_squared.x,
445
+ roughness_v: local_roughness_squared.y,
446
+ tint: local_reflection_color,
447
+ tangent_u: ::state::texture_tangent_u(0),
448
+ mode: ::df::scatter_reflect
449
+ );
450
+
451
+ bsdf ggx_2 = ::df::microfacet_ggx_smith_bsdf(
452
+ roughness_u: local_roughness_squared.x,
453
+ roughness_v: local_roughness_squared.y,
454
+ tint: local_transmission_color,
455
+ tangent_u: ::state::texture_tangent_u(0),
456
+ mode: ::df::scatter_transmit
457
+ );
458
+
459
+ material_surface local_surface(
460
+ ::df::fresnel_layer(
461
+ ior: glass_ior,
462
+ weight: 1.f,
463
+ layer: ggx_1,
464
+ base: ggx_2,
465
+ normal: the_normal
466
+ ),
467
+ material_emission()
468
+ );
469
+
470
+
471
+ // Volume Properties
472
+ color local_volume_absorption = depth;
473
+ color local_volume_scattering = color(0.f, 0.f, 0.f);
474
+
475
+ material_volume local_volume(vdf(), local_volume_absorption, local_volume_scattering);
476
+
477
+
478
+ // Geometry Properties
479
+ material_geometry local_geometry(float3(0.f), local_cutout_opacity, the_normal);
480
+
481
+ } in material(
482
+ thin_walled: local_thin_walled,
483
+ surface: local_surface,
484
+ ior: local_glass_ior,
485
+ volume: local_volume,
486
+ geometry: local_geometry
487
+ );
saved/assets/_dependencies/public_validation/materials/OmniPBR.mdl ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::anno::*;
38
+
39
+ import ::debug::*;
40
+
41
+ import ::nvidia::core_definitions::file_texture;
42
+ import ::nvidia::core_definitions::normalmap_texture;
43
+
44
+ import OmniPBR_ClearCoat::*;
45
+
46
+
47
+ // OmniPBR //
48
+
49
+ export material OmniPBR(
50
+
51
+ // Albdeo //
52
+
53
+ color diffuse_color_constant = color(0.2) [[
54
+ anno::display_name("Albedo Color"),
55
+ anno::description("This is the albedo base color"),
56
+ anno::in_group("Albedo")
57
+ ]],
58
+ uniform texture_2d diffuse_texture = texture_2d() [[
59
+ anno::display_name("Albedo Map"),
60
+ anno::in_group("Albedo")
61
+ ]],
62
+ float albedo_desaturation = float(0.0) [[
63
+ anno::display_name("Albedo Desaturation"),
64
+ anno::description("Desaturates the diffuse color"),
65
+ anno::in_group("Albedo"),
66
+ anno::soft_range(float(0.0), float(1.0))
67
+ ]],
68
+ float albedo_add = float(0.0) [[
69
+ anno::display_name("Albedo Add"),
70
+ anno::description("Adds a constant value to the diffuse color "),
71
+ anno::in_group("Albedo"),
72
+ anno::soft_range(float(-1.0), float(1.0))
73
+ ]],
74
+ float albedo_brightness = float(1.0) [[
75
+ anno::display_name("Albedo Brightness"),
76
+ anno::description("Multiplier for the diffuse color "),
77
+ anno::in_group("Albedo"),
78
+ anno::soft_range(float(0.0), float(1.0))
79
+ ]],
80
+ color diffuse_tint = color(1.0) [[
81
+ anno::display_name("Color Tint"),
82
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
83
+ anno::in_group("Albedo")
84
+ ]],
85
+
86
+
87
+ // Reflectivity //
88
+
89
+ float reflection_roughness_constant = float(0.5) [[
90
+ anno::display_name("Roughness Amount"),
91
+ anno::description("Higher roughness values lead to more blurry reflections"),
92
+ anno::in_group("Reflectivity"),
93
+ anno::hard_range(float(0.0), float(1.0))
94
+ ]],
95
+ float reflection_roughness_texture_influence = float(0.0) [[
96
+ anno::display_name("Roughness Map Influence"),
97
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
98
+ anno::in_group("Reflectivity"),
99
+ anno::hard_range(float(0.0), float(1.0))
100
+ ]],
101
+ uniform texture_2d reflectionroughness_texture = texture_2d() [[
102
+ anno::display_name("Roughness Map"),
103
+ anno::in_group("Reflectivity"),
104
+ anno::usage("roughness")
105
+ ]],
106
+ float metallic_constant = float(0.0) [[
107
+ anno::display_name("Metallic Amount"),
108
+ anno::description("Metallic Material"),
109
+ anno::in_group("Reflectivity"),
110
+ anno::hard_range(float(0.0), float(1.0))
111
+ ]],
112
+ float metallic_texture_influence = float(0.0) [[
113
+ anno::display_name("Metallic Map Influence"),
114
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
115
+ anno::in_group("Reflectivity"),
116
+ anno::hard_range(float(0.0), float(1.0))
117
+ ]],
118
+ uniform texture_2d metallic_texture = texture_2d() [[
119
+ anno::display_name("Metallic Map"),
120
+ anno::in_group("Reflectivity"),
121
+ anno::usage("metalness")
122
+ ]],
123
+ float specular_level = float(0.5) [[
124
+ anno::display_name("Specular"),
125
+ anno::description("The specular level (intensity) of the material"),
126
+ anno::in_group("Reflectivity"),
127
+ anno::soft_range(float(0.0), float(1.0))
128
+ ]],
129
+
130
+
131
+ // ORM //
132
+
133
+ uniform bool enable_ORM_texture = false [[
134
+ anno::display_name("Enable ORM Texture"),
135
+ anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
136
+ anno::in_group("Reflectivity")
137
+ ]],
138
+ uniform texture_2d ORM_texture = texture_2d() [[
139
+ anno::display_name("ORM Map"),
140
+ anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
141
+ anno::in_group("Reflectivity"),
142
+ anno::usage("roughness")
143
+ ]],
144
+
145
+
146
+ // AO Group //
147
+
148
+ float ao_to_diffuse = 0.0 [[
149
+ anno::display_name("AO to diffuse"),
150
+ anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
151
+ anno::in_group("AO"),
152
+ anno::hard_range(float(0.0), float(1.0))
153
+ ]],
154
+ uniform texture_2d ao_texture = texture_2d() [[
155
+ anno::display_name("Ambient Occlusion Map"),
156
+ anno::description("The ambient occlusion texture for the material"),
157
+ anno::in_group("AO"),
158
+ anno::usage("occlusion")
159
+ ]],
160
+
161
+
162
+ // Emission //
163
+
164
+ uniform bool enable_emission = false [[
165
+ anno::display_name("Enable Emission"),
166
+ anno::description("Enables the emission of light from the material"),
167
+ anno::in_group("Emissive")
168
+ ]],
169
+ color emissive_color = color(1.0,0.1,0.1) [[
170
+ anno::display_name("Emissive Color"),
171
+ anno::description("The emission color"),
172
+ anno::in_group("Emissive"),
173
+ anno::enable_if("enable_emission == true")
174
+ ]],
175
+ uniform texture_2d emissive_color_texture = texture_2d() [[
176
+ anno::display_name("Emissive Color map"),
177
+ anno::in_group("Emissive"),
178
+ anno::description("The emissive color texture"),
179
+ anno::enable_if("enable_emission == true")
180
+ ]],
181
+ uniform texture_2d emissive_mask_texture = texture_2d() [[
182
+ anno::display_name("Emissive Mask map"),
183
+ anno::description("The texture masking the emissive color"),
184
+ anno::in_group("Emissive"),
185
+ anno::enable_if("enable_emission == true"),
186
+ anno::usage("occlusion")
187
+ ]],
188
+ float emissive_intensity = float(40.0) [[
189
+ anno::display_name("Emissive Intensity"),
190
+ anno::description("Intensity of the emission"),
191
+ anno::in_group("Emissive"),
192
+ anno::enable_if("enable_emission == true")
193
+ ]],
194
+
195
+
196
+ // Cutout Opacity //
197
+
198
+ uniform bool enable_opacity = false [[
199
+ anno::display_name("Enable Opacity"),
200
+ anno::description("Enables the use of cutout opacity"),
201
+ anno::in_group("Opacity")
202
+ ]],
203
+ uniform texture_2d opacity_texture = texture_2d() [[
204
+ anno::display_name("Opacity Map"),
205
+ anno::in_group("Opacity"),
206
+ anno::usage("opacity")
207
+ ]],
208
+ float opacity_constant = float(1.0) [[
209
+ anno::display_name("Opacity Amount"),
210
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
211
+ anno::in_group("Opacity"),
212
+ anno::hard_range(float(0.0), float(1.0))
213
+ ]],
214
+ uniform bool enable_opacity_texture = false [[
215
+ anno::display_name("Enable Opacity Texture"),
216
+ anno::description("Enables or disables the usage of the opacity texture map"),
217
+ anno::in_group("Opacity")
218
+ ]],
219
+ uniform base::mono_mode opacity_mode = base::mono_average [[
220
+ anno::display_name("Opacity Mono Source"),
221
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
222
+ anno::in_group("Opacity")
223
+ ]],
224
+ uniform float opacity_threshold = float(0.0) [[
225
+ anno::hard_range(0.0, 1.0),
226
+ anno::display_name("Opacity Threshold"),
227
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
228
+ anno::in_group("Opacity")
229
+ ]],
230
+
231
+
232
+
233
+ // Normal //
234
+
235
+ uniform float geometry_normal_roughness_strength = 1.f
236
+ [[
237
+ anno::hard_range(0.0, 1.0),
238
+ anno::display_name("Normal map to roughness weight"),
239
+ anno::description("Enables and weights roughness induced by normal maps"),
240
+ anno::in_group("Normal")
241
+ ]],
242
+ uniform float bump_factor = float(1.0) [[
243
+ anno::display_name("Normal Strength"),
244
+ anno::description("Strength of normal map"),
245
+ anno::in_group("Normal"),
246
+ anno::soft_range(float(0.0), float(1.0))
247
+ ]],
248
+ uniform texture_2d normalmap_texture = texture_2d() [[
249
+ anno::display_name("Normal Map"),
250
+ anno::in_group("Normal"),
251
+ anno::usage("normal")
252
+ ]],
253
+ uniform float detail_bump_factor = float(0.3) [[
254
+ anno::display_name("Detail Normal Strength"),
255
+ anno::in_group("Normal"),
256
+ anno::description("Strength of the detail normal"),
257
+ anno::soft_range(float(0.0), float(1.0))
258
+ ]],
259
+ uniform texture_2d detail_normalmap_texture = texture_2d() [[
260
+ anno::display_name("Detail Normal Map"),
261
+ anno::in_group("Normal"),
262
+ anno::usage("normal")
263
+ ]],
264
+ uniform bool flip_tangent_u = false [[
265
+ anno::display_name("Normal Map Flip U Tangent"),
266
+ anno::in_group("Normal")
267
+ ]],
268
+ uniform bool flip_tangent_v = true [[
269
+ anno::display_name("Normal Map Flip V Tangent"),
270
+ anno::in_group("Normal")
271
+ ]],
272
+
273
+ // UVW Projection Group //
274
+
275
+ uniform bool project_uvw = false [[
276
+ anno::display_name("Enable Project UVW Coordinates"),
277
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
278
+ anno::in_group("UV")
279
+ ]],
280
+ uniform bool world_or_object = false [[
281
+ anno::display_name("Enable World Space"),
282
+ anno::description("When enabled, uses world space for projection, otherwise object space is used"),
283
+ anno::in_group("UV"),
284
+ anno::enable_if("project_uvw == true")
285
+ ]],
286
+ uniform int uv_space_index = 0 [[
287
+ anno::display_name("UV Space Index"),
288
+ anno::description("UV Space Index."),
289
+ anno::in_group("UV"),
290
+ anno::enable_if("project_uvw == true"),
291
+ anno::hard_range(int(0), int(3))
292
+ ]],
293
+
294
+ // UVW Adjustments Group //
295
+
296
+ uniform float2 texture_translate = float2(0.0) [[
297
+ anno::display_name("Texture Translate"),
298
+ anno::description("Controls position of texture."),
299
+ anno::in_group("UV"),
300
+ anno::enable_if("project_uvw == true")
301
+ ]],
302
+ uniform float texture_rotate = float(0.0) [[
303
+ anno::display_name("Texture Rotate"),
304
+ anno::description("Rotates angle of texture in degrees."),
305
+ anno::in_group("UV"),
306
+ anno::enable_if("project_uvw == true")
307
+ ]],
308
+ uniform float2 texture_scale = float2(1.0) [[
309
+ anno::display_name("Texture Tiling"),
310
+ anno::description("Controls the repetition of the texture."),
311
+ anno::in_group("UV"),
312
+ anno::enable_if("project_uvw == true")
313
+ ]],
314
+ uniform float2 detail_texture_translate = float2(0.0) [[
315
+ anno::display_name("Detail Texture Translate"),
316
+ anno::description("Controls the position of the detail texture."),
317
+ anno::in_group("UV"),
318
+ anno::enable_if("project_uvw == true")
319
+ ]],
320
+ uniform float detail_texture_rotate = float(0.0) [[
321
+ anno::display_name("Detail Texture Rotate"),
322
+ anno::description("Rotates angle of the detail texture in degrees."),
323
+ anno::in_group("UV"),
324
+ anno::enable_if("project_uvw == true")
325
+ ]],
326
+ uniform float2 detail_texture_scale = float2(1.0) [[
327
+ anno::display_name("Detail Texture Tiling"),
328
+ anno::description("Controls the repetition of the detail texture."),
329
+ anno::in_group("UV"),
330
+ anno::enable_if("project_uvw == true")
331
+ ]]
332
+ )
333
+ [[
334
+ anno::display_name("OmniPBR"),
335
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
336
+ anno::in_group("Base"),
337
+ anno::version( 2, 1, 2),
338
+ anno::author("NVIDIA CORPORATION"),
339
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
340
+ ]] = let {
341
+
342
+ material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat(
343
+ diffuse_color_constant: diffuse_color_constant,
344
+ diffuse_texture: diffuse_texture,
345
+ albedo_desaturation: albedo_desaturation,
346
+ albedo_add: albedo_add,
347
+ albedo_brightness: albedo_brightness,
348
+ diffuse_tint: diffuse_tint,
349
+ reflection_roughness_constant: reflection_roughness_constant,
350
+ reflection_roughness_texture_influence: reflection_roughness_texture_influence,
351
+ reflectionroughness_texture: reflectionroughness_texture,
352
+ metallic_constant: metallic_constant,
353
+ metallic_texture_influence: metallic_texture_influence,
354
+ metallic_texture: metallic_texture,
355
+ specular_level: specular_level,
356
+ enable_ORM_texture: enable_ORM_texture,
357
+ ORM_texture: ORM_texture,
358
+ ao_to_diffuse: ao_to_diffuse,
359
+ ao_texture: ao_texture,
360
+ enable_emission: enable_emission,
361
+ emissive_color: emissive_color,
362
+ emissive_color_texture: emissive_color_texture,
363
+ emissive_mask_texture: emissive_mask_texture,
364
+ emissive_intensity: emissive_intensity,
365
+ enable_opacity: enable_opacity,
366
+ opacity_texture: opacity_texture,
367
+ opacity_constant: opacity_constant,
368
+ enable_opacity_texture: enable_opacity_texture,
369
+ opacity_mode: opacity_mode,
370
+ opacity_threshold: opacity_threshold,
371
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
372
+ bump_factor: bump_factor,
373
+ normalmap_texture: normalmap_texture,
374
+ detail_bump_factor: detail_bump_factor,
375
+ detail_normalmap_texture: detail_normalmap_texture,
376
+ flip_tangent_u: flip_tangent_u,
377
+ flip_tangent_v: flip_tangent_v,
378
+ project_uvw: project_uvw,
379
+ world_or_object: world_or_object,
380
+ uv_space_index: uv_space_index,
381
+ texture_translate: texture_translate,
382
+ texture_rotate: texture_rotate,
383
+ texture_scale: texture_scale,
384
+ detail_texture_translate: detail_texture_translate,
385
+ detail_texture_rotate: detail_texture_rotate,
386
+ detail_texture_scale: detail_texture_scale
387
+ );
388
+
389
+ } in material(
390
+ surface: base.surface,
391
+ geometry: base.geometry
392
+ );
saved/assets/_dependencies/public_validation/materials/OmniPBRBase.mdl ADDED
@@ -0,0 +1,493 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::tex::*;
36
+ import ::anno::*;
37
+ import ::anno::*;
38
+
39
+ export float3 HemiOctahedronToUnitVector( float2 Oct ) [[
40
+ anno::hidden()
41
+ ]]
42
+ {
43
+ Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5;
44
+ float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) );
45
+ return math::normalize(N);
46
+ }
47
+
48
+ export struct NormalData [[
49
+ anno::hidden()
50
+ ]]
51
+ {
52
+ float3 normal;
53
+ float2 roughness;
54
+ };
55
+
56
+ export NormalData tangent_space_normal_roughness_texture(
57
+ uniform texture_2d texture
58
+ [[
59
+ anno::description("The input texture"),
60
+ anno::usage("normal")
61
+ ]],
62
+ uniform float factor = 1.0f
63
+ [[ anno::description("Determines the degree of bumpiness") ]],
64
+ uniform bool flip_tangent_u = false
65
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
66
+ uniform bool flip_tangent_v = false
67
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
68
+ base::texture_coordinate_info uvw = base::texture_coordinate_info()
69
+ [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]],
70
+ uniform float2 crop_u = float2( 0.0, 1.0)
71
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]],
72
+ uniform float2 crop_v = float2( 0.0, 1.0)
73
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]],
74
+ uniform tex::wrap_mode wrap_u = tex::wrap_repeat
75
+ [[ anno::description("Wrapping mode in the u direction") ]],
76
+ uniform tex::wrap_mode wrap_v = tex::wrap_repeat
77
+ [[ anno::description("Wrapping mode in the v direction") ]],
78
+ uniform bool clip = false
79
+ [[
80
+ anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"),
81
+ anno::hidden()
82
+ ]],
83
+ uniform float scale = 1.
84
+ [[
85
+ anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"),
86
+ anno::unused()
87
+ ]],
88
+ uniform float offset = 0.
89
+ [[
90
+ anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"),
91
+ anno::unused()
92
+ ]],
93
+ uniform float animation_start_time = 0.
94
+ [[ anno::description("When to start playing first frame of the animation ") ]],
95
+ uniform int2 animation_crop = int2(0, 0)
96
+ [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]],
97
+ uniform tex::wrap_mode animation_wrap = tex::wrap_repeat
98
+ [[ anno::description("Defines what to do outside of regular animation time") ]],
99
+ uniform float animation_fps = 30
100
+ [[ anno::description("Framerate to use for animation playback") ]]
101
+ )
102
+ [[
103
+ anno::description("Interprets the color values of a bitmap as a vector in tangent space"),
104
+ anno::hidden(),
105
+ anno::noinline()
106
+ ]]
107
+ {
108
+ NormalData normalData;
109
+ normalData.roughness = float2(0);
110
+ normalData.normal = state::normal();
111
+
112
+ float frame = 0.0;
113
+ if(animation_crop != int2(0,0)) //only if we have an animation
114
+ {
115
+ frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation
116
+ switch ( animation_wrap) {
117
+ case tex::wrap_repeat:
118
+ frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x:
119
+ math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y;
120
+ break;
121
+ case tex::wrap_mirrored_repeat:
122
+ float animation_crop_2y = 2.0*animation_crop.y;
123
+ frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x:
124
+ math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x;
125
+ if(frame>animation_crop.y)
126
+ frame = animation_crop_2y-frame;
127
+ break;
128
+ case tex::wrap_clamp:
129
+ frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y);
130
+ break;
131
+ case tex::wrap_clip:
132
+ frame += animation_crop.x;
133
+ if(frame < animation_crop.x || frame > animation_crop.y) return normalData;
134
+ break;
135
+ }
136
+ }
137
+
138
+ if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource
139
+ factor == 0.0f)
140
+ return normalData;
141
+ {
142
+ if (clip) {
143
+ if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) {
144
+ return normalData;
145
+ }
146
+ if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) {
147
+ return normalData;
148
+ }
149
+ }
150
+ if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) {
151
+ return normalData;
152
+ }
153
+ if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) {
154
+ return normalData;
155
+ }
156
+ }
157
+ bool pixel_flip_u = flip_tangent_u;
158
+ bool pixel_flip_v = flip_tangent_v;
159
+ //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
160
+ if (wrap_u == tex::wrap_mirrored_repeat) {
161
+ if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1)
162
+ pixel_flip_u = ! pixel_flip_u;
163
+ else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0)
164
+ pixel_flip_u = ! pixel_flip_u;
165
+ }
166
+ if (wrap_v == tex::wrap_mirrored_repeat) {
167
+ if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1)
168
+ pixel_flip_v = ! pixel_flip_v;
169
+ else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0)
170
+ pixel_flip_v = ! pixel_flip_v;
171
+ }
172
+
173
+ float3 transformed_tangent_u = uvw.tangent_u;
174
+ float3 transformed_tangent_v = uvw.tangent_v;
175
+
176
+ if (pixel_flip_u)
177
+ transformed_tangent_u=-transformed_tangent_u;
178
+ if (pixel_flip_v)
179
+ transformed_tangent_v=-transformed_tangent_v;
180
+
181
+ float3 tangent_space_normal;
182
+ float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame);
183
+ if(normal_raw.x > 1.5)
184
+ {
185
+ // octahedron packed by OV
186
+ normal_raw.x -= 2.0;
187
+ normal_raw.x -= 0.5;
188
+ normal_raw.y -= 0.5;
189
+ tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0);
190
+ normalData.roughness = float2(normal_raw.z, normal_raw.w);
191
+ }
192
+ else
193
+ {
194
+ // regular
195
+ tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0;
196
+ normalData.roughness = float2(0);
197
+ }
198
+
199
+ normalData.normal = math::normalize(
200
+ transformed_tangent_u * tangent_space_normal.x * factor +
201
+ transformed_tangent_v * tangent_space_normal.y * factor +
202
+ state::normal() * tangent_space_normal.z);
203
+
204
+ return normalData;
205
+ }
206
+
207
+
208
+ export material OmniPBRBase(
209
+
210
+
211
+ // Albdeo //
212
+
213
+ color diffuse_reflection_color = color(0.2) [[
214
+ anno::display_name("Albedo Color"),
215
+ anno::description("This is the albedo base color"),
216
+ anno::in_group("Albedo")
217
+ ]],
218
+ color diffuse_tint = color(1.0) [[
219
+ anno::display_name("Albedo Tint"),
220
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
221
+ anno::in_group("Albedo")
222
+ ]],
223
+
224
+
225
+ // Reflecitivity //
226
+
227
+ float specular_reflection_roughness = float(0.0) [[
228
+ anno::display_name("Roughness"),
229
+ anno::description("Higher roughness values lead to more blurry reflections"),
230
+ anno::in_group("Reflectivity"),
231
+ anno::hard_range(0.0, 1.0)
232
+ ]],
233
+ float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[
234
+ anno::display_name("Aniso roughness"),
235
+ anno::description("Higher roughness values lead to more blurry reflections"),
236
+ anno::in_group("Reflectivity"),
237
+ anno::hidden()
238
+ ]],
239
+ float metalness = float(0.0) [[
240
+ anno::display_name("Metalness"),
241
+ anno::description("Bias towards pure specular reflection"),
242
+ anno::in_group("Reflectivity"),
243
+ anno::hard_range(0.0, 1.0)
244
+ ]],
245
+ float specular_level = float(0.5) [[
246
+ anno::display_name("Specular"),
247
+ anno::description("The specular level (intensity) of the material"),
248
+ anno::in_group("Reflectivity"),
249
+ anno::soft_range(0.0, 1.0)
250
+ ]],
251
+
252
+
253
+ // Emission //
254
+
255
+ uniform bool enable_emission = false [[
256
+ anno::display_name("Enable Emission"),
257
+ anno::description("Enables the emission of light from the material"),
258
+ anno::in_group("Emissive")
259
+ ]],
260
+ color emission_color = color(1.0,0.1,0.1) [[
261
+ anno::display_name("Emissive Color"),
262
+ anno::description("The emission color"),
263
+ anno::in_group("Emissive"),
264
+ anno::enable_if("enable_emission == true")
265
+ ]],
266
+ float emission_intensity = float(40.0) [[
267
+ anno::display_name("Emissive Intensity"),
268
+ anno::description("Intensity of the emission"),
269
+ anno::in_group("Emissive"),
270
+ anno::soft_range(0.0, 1000.0),
271
+ anno::enable_if("enable_emission == true")
272
+ ]],
273
+
274
+
275
+ // Geometry Opacity //
276
+
277
+ uniform bool enable_opacity = false [[
278
+ anno::display_name("Enable Opacity"),
279
+ anno::description("Enables the use of cutout opacity"),
280
+ anno::in_group("Opacity")
281
+ ]],
282
+ float geometry_opacity = float(1.0) [[
283
+ anno::display_name("Opacity Amount"),
284
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
285
+ anno::in_group("Opacity"),
286
+ anno::hard_range(0.0, 1.0)
287
+ ]],
288
+ uniform float geometry_opacity_threshold = 0.f
289
+ [[
290
+ anno::display_name("Opacity Threshold"),
291
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
292
+ anno::in_group("Opacity"),
293
+ anno::hard_range(0.0, 1.0)
294
+ ]],
295
+
296
+
297
+ // Clearcoat //
298
+
299
+ uniform bool enable_coat = false [[
300
+ anno::display_name("Enable Clearcoat Layer"),
301
+ anno::description("Adds a coat layer on top of the material when enabled"),
302
+ anno::in_group("Clearcoat")
303
+ ]],
304
+ float coat_weight = float(1.0) [[
305
+ anno::display_name("Clearcoat Weight"),
306
+ anno::description("Sets the weight for coat layer"),
307
+ anno::in_group("Clearcoat"),
308
+ anno::hard_range(0.0, 1.0)
309
+ ]],
310
+ color coat_color = color(1.0) [[
311
+ anno::display_name("Clearcoat Tint"),
312
+ anno::description("Clearcoat is tinted and affects the underlying material"),
313
+ anno::in_group("Clearcoat")
314
+ ]],
315
+ float coat_transparency = float(1.0) [[
316
+ anno::display_name("Clearcoat Transparency"),
317
+ anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"),
318
+ anno::in_group("Clearcoat"),
319
+ anno::hard_range(0.0, 1.0)
320
+ ]],
321
+ float coat_roughness = float(0.0) [[
322
+ anno::display_name("Clearcoat Roughness"),
323
+ anno::description("Higher roughness values lead to more blurry reflections"),
324
+ anno::in_group("Clearcoat"),
325
+ anno::hard_range(0.0, 1.0)
326
+ ]],
327
+ float2 coat_aniso_roughness = float2(0.0, 0.0) [[
328
+ anno::display_name("Clearcoat aniso roughness"),
329
+ anno::description("Higher roughness values lead to more blurry reflections"),
330
+ anno::in_group("Clearcoat"),
331
+ anno::hidden()
332
+ ]],
333
+ float coat_ior = float(1.56) [[
334
+ anno::display_name("Clearcoat IOR"),
335
+ anno::description("Sets the Index of refraction for the coat layer"),
336
+ anno::in_group("Clearcoat"),
337
+ anno::soft_range(0.0, 4.0)
338
+ ]],
339
+ float3 clearcoat_geometry_normal = state::normal() [[
340
+ anno::display_name("Clearcoat Normal"),
341
+ anno::in_group("Clearcoat"),
342
+ anno::usage("normal")
343
+ ]],
344
+
345
+
346
+ // Geometry //
347
+
348
+ uniform float round_edges_radius = float(0.0) [[
349
+ anno::display_name("Round Edge Radius"),
350
+ anno::description("Influence radius around the edges in meters"),
351
+ anno::in_group("Geometry"),
352
+ anno::soft_range(0.0, 1.0)
353
+ ]],
354
+ uniform float round_edges_roundness = float(1.0) [[
355
+ anno::display_name("Round Edge Roundness"),
356
+ anno::description("Determines how round the edge will look"),
357
+ anno::in_group("Geometry"),
358
+ anno::hard_range(0.0, 1.0)
359
+ ]],
360
+ uniform bool round_edges_across_materials = false [[
361
+ anno::display_name("Round Edge Across Materials"),
362
+ anno::description("Normal smoothing happens only between facets of equal material, \n"
363
+ "\t\tunless this parameter is set true, in which case the smoothing \n"
364
+ "\t\thappens between facets irrespective of their materials"),
365
+ anno::in_group("Geometry")
366
+ ]],
367
+ float3 geometry_normal = state::normal() [[
368
+ anno::display_name("Geometry Normal"),
369
+ anno::in_group("Geometry"),
370
+ anno::usage("normal")
371
+ ]]
372
+
373
+ )
374
+ [[
375
+ anno::display_name("OmniPBR Base"),
376
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
377
+ anno::in_group("Omni Materials"),
378
+ anno::version( 2, 1, 1),
379
+ anno::author("NVIDIA CORPORATION"),
380
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
381
+ ]]
382
+ = let{
383
+
384
+ // Diffuse Bsdf //
385
+
386
+ color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint;
387
+
388
+ color base_color = tinted_diffuse_color;
389
+
390
+ bsdf diffuse_bsdf = df::weighted_layer(
391
+ weight: 1.0,
392
+ layer: df::diffuse_reflection_bsdf(
393
+ tint: base_color,
394
+ roughness: float(0.0)
395
+ ),
396
+ base: bsdf(),
397
+ normal: geometry_normal
398
+ );
399
+
400
+ // Glossy Reflection Bsdf //
401
+
402
+ float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness
403
+ + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1);
404
+ float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness
405
+ + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1);
406
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
407
+ roughness_u: roughness_u,
408
+ roughness_v: roughness_v,
409
+ tint: color(1.0),
410
+ mode: df::scatter_reflect
411
+ );
412
+
413
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
414
+ normal_reflectivity: 0.08,
415
+ grazing_reflectivity: 1.0,
416
+ exponent: 5.0,
417
+ weight: specular_level,
418
+ layer: ggx_smith_bsdf,
419
+ base: diffuse_bsdf,
420
+ normal: geometry_normal
421
+ );
422
+
423
+ bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
424
+
425
+ bsdf omni_PBR_bsdf = df::weighted_layer(
426
+ weight: metalness,
427
+ layer: directional_factor_bsdf,
428
+ base: custom_curve_layer_bsdf,
429
+ normal: geometry_normal
430
+ );
431
+
432
+ // Clear Coat //
433
+
434
+ float coat_roughness_u = math::clamp(coat_roughness * coat_roughness
435
+ + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1);
436
+ float coat_roughness_v = math::clamp(coat_roughness * coat_roughness
437
+ + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1);
438
+ bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf(
439
+ roughness_u: coat_roughness_u,
440
+ roughness_v: coat_roughness_v,
441
+ tint: color(1.0),
442
+ mode: df::scatter_reflect
443
+ );
444
+
445
+ bsdf opaque_coat = df::weighted_layer(
446
+ weight: coat_transparency,
447
+ layer: ::df::tint(
448
+ tint: coat_color,
449
+ base: omni_PBR_bsdf
450
+ ),
451
+ base: ::df::diffuse_reflection_bsdf(
452
+ tint: coat_color
453
+ )
454
+ );
455
+
456
+ bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
457
+ ior: coat_ior,
458
+ weight: coat_weight,
459
+ layer: coat_bsdf,
460
+ base: opaque_coat,
461
+ normal: clearcoat_geometry_normal
462
+ );
463
+
464
+ bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
465
+
466
+ color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0);
467
+
468
+ float opacity_value = geometry_opacity;
469
+ float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0;
470
+
471
+ material_emission emission = material_emission(
472
+ df::diffuse_edf(),
473
+ intensity: emission_value
474
+ );
475
+
476
+ material_surface surface = material_surface(
477
+ scattering: final_bsdf,
478
+ emission: emission
479
+ );
480
+
481
+ material_geometry geometry = material_geometry(
482
+ normal: state::rounded_corner_normal(
483
+ radius: round_edges_radius,
484
+ across_materials: round_edges_across_materials,
485
+ roundness: round_edges_roundness
486
+ ),
487
+ cutout_opacity: cutout_opacity
488
+ );
489
+
490
+ } in material(
491
+ surface: surface,
492
+ geometry: geometry
493
+ );
saved/assets/_dependencies/public_validation/materials/OmniPBRBase_1.mdl ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::tex::*;
36
+ import ::anno::*;
37
+ import ::anno::*;
38
+
39
+ export float3 HemiOctahedronToUnitVector( float2 Oct )
40
+ {
41
+ Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5;
42
+ float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) );
43
+ return math::normalize(N);
44
+ }
45
+
46
+ export struct NormalData {
47
+ float3 normal;
48
+ float2 roughness;
49
+ };
50
+
51
+ export NormalData tangent_space_normal_roughness_texture(
52
+ uniform texture_2d texture
53
+ [[
54
+ anno::description("The input texture"),
55
+ anno::usage("normal")
56
+ ]],
57
+ uniform float factor = 1.0f
58
+ [[ anno::description("Determines the degree of bumpiness") ]],
59
+ uniform bool flip_tangent_u = false
60
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
61
+ uniform bool flip_tangent_v = false
62
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
63
+ base::texture_coordinate_info uvw = base::texture_coordinate_info()
64
+ [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]],
65
+ uniform float2 crop_u = float2( 0.0, 1.0)
66
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]],
67
+ uniform float2 crop_v = float2( 0.0, 1.0)
68
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]],
69
+ uniform tex::wrap_mode wrap_u = tex::wrap_repeat
70
+ [[ anno::description("Wrapping mode in the u direction") ]],
71
+ uniform tex::wrap_mode wrap_v = tex::wrap_repeat
72
+ [[ anno::description("Wrapping mode in the v direction") ]],
73
+ uniform bool clip = false
74
+ [[
75
+ anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"),
76
+ anno::hidden()
77
+ ]],
78
+ uniform float scale = 1.
79
+ [[
80
+ anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"),
81
+ anno::unused()
82
+ ]],
83
+ uniform float offset = 0.
84
+ [[
85
+ anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"),
86
+ anno::unused()
87
+ ]],
88
+ uniform float animation_start_time = 0.
89
+ [[ anno::description("When to start playing first frame of the animation ") ]],
90
+ uniform int2 animation_crop = int2(0, 0)
91
+ [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]],
92
+ uniform tex::wrap_mode animation_wrap = tex::wrap_repeat
93
+ [[ anno::description("Defines what to do outside of regular animation time") ]],
94
+ uniform float animation_fps = 30
95
+ [[ anno::description("Framerate to use for animation playback") ]]
96
+ )
97
+ [[
98
+ anno::description("Interprets the color values of a bitmap as a vector in tangent space"),
99
+ anno::noinline()
100
+ ]]
101
+ {
102
+ NormalData normalData;
103
+ normalData.roughness = float2(0);
104
+ normalData.normal = state::normal();
105
+
106
+ float frame = 0.0;
107
+ if(animation_crop != int2(0,0)) //only if we have an animation
108
+ {
109
+ frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation
110
+ switch ( animation_wrap) {
111
+ case tex::wrap_repeat:
112
+ frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x:
113
+ math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y;
114
+ break;
115
+ case tex::wrap_mirrored_repeat:
116
+ float animation_crop_2y = 2.0*animation_crop.y;
117
+ frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x:
118
+ math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x;
119
+ if(frame>animation_crop.y)
120
+ frame = animation_crop_2y-frame;
121
+ break;
122
+ case tex::wrap_clamp:
123
+ frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y);
124
+ break;
125
+ case tex::wrap_clip:
126
+ frame += animation_crop.x;
127
+ if(frame < animation_crop.x || frame > animation_crop.y) return normalData;
128
+ break;
129
+ }
130
+ }
131
+
132
+ if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource
133
+ factor == 0.0f)
134
+ return normalData;
135
+ {
136
+ if (clip) {
137
+ if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) {
138
+ return normalData;
139
+ }
140
+ if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) {
141
+ return normalData;
142
+ }
143
+ }
144
+ if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) {
145
+ return normalData;
146
+ }
147
+ if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) {
148
+ return normalData;
149
+ }
150
+ }
151
+ bool pixel_flip_u = flip_tangent_u;
152
+ bool pixel_flip_v = flip_tangent_v;
153
+ //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
154
+ if (wrap_u == tex::wrap_mirrored_repeat) {
155
+ if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1)
156
+ pixel_flip_u = ! pixel_flip_u;
157
+ else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0)
158
+ pixel_flip_u = ! pixel_flip_u;
159
+ }
160
+ if (wrap_v == tex::wrap_mirrored_repeat) {
161
+ if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1)
162
+ pixel_flip_v = ! pixel_flip_v;
163
+ else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0)
164
+ pixel_flip_v = ! pixel_flip_v;
165
+ }
166
+
167
+ float3 transformed_tangent_u = uvw.tangent_u;
168
+ float3 transformed_tangent_v = uvw.tangent_v;
169
+
170
+ if (pixel_flip_u)
171
+ transformed_tangent_u=-transformed_tangent_u;
172
+ if (pixel_flip_v)
173
+ transformed_tangent_v=-transformed_tangent_v;
174
+
175
+ float3 tangent_space_normal;
176
+ float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame);
177
+ if(normal_raw.x > 1.5)
178
+ {
179
+ // octahedron packed by OV
180
+ normal_raw.x -= 2.0;
181
+ normal_raw.x -= 0.5;
182
+ normal_raw.y -= 0.5;
183
+ tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0);
184
+ normalData.roughness = float2(normal_raw.z, normal_raw.w);
185
+ }
186
+ else
187
+ {
188
+ // regular
189
+ tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0;
190
+ normalData.roughness = float2(0);
191
+ }
192
+
193
+ normalData.normal = math::normalize(
194
+ transformed_tangent_u * tangent_space_normal.x * factor +
195
+ transformed_tangent_v * tangent_space_normal.y * factor +
196
+ state::normal() * tangent_space_normal.z);
197
+
198
+ return normalData;
199
+ }
200
+
201
+
202
+ export material OmniPBRBase(
203
+
204
+
205
+ // Albdeo //
206
+
207
+ color diffuse_reflection_color = color(0.2) [[
208
+ anno::display_name("Albedo Color"),
209
+ anno::description("This is the albedo base color"),
210
+ anno::in_group("Albedo")
211
+ ]],
212
+ color diffuse_tint = color(1.0) [[
213
+ anno::display_name("Albedo Tint"),
214
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
215
+ anno::in_group("Albedo")
216
+ ]],
217
+
218
+
219
+ // Reflecitivity //
220
+
221
+ float specular_reflection_roughness = float(0.0) [[
222
+ anno::display_name("Roughness"),
223
+ anno::description("Higher roughness values lead to more blurry reflections"),
224
+ anno::in_group("Reflectivity")
225
+ ]],
226
+ float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[
227
+ anno::display_name("Aniso roughness"),
228
+ anno::description("Higher roughness values lead to more blurry reflections"),
229
+ anno::in_group("Reflectivity"),
230
+ anno::hidden()
231
+ ]],
232
+ float metalness = float(0.0) [[
233
+ anno::display_name("Metalness"),
234
+ anno::description("Bias towards pure specular reflection"),
235
+ anno::in_group("Reflectivity"),
236
+ anno::hard_range(float(0.0), float(1.0))
237
+ ]],
238
+ float specular_level = float(0.5) [[
239
+ anno::display_name("Specular"),
240
+ anno::description("The specular level (intensity) of the material"),
241
+ anno::in_group("Reflectivity"),
242
+ anno::soft_range(float(0.0), float(1.0))
243
+ ]],
244
+
245
+
246
+ // Emission //
247
+
248
+ uniform bool enable_emission = false [[
249
+ anno::display_name("Enable Emission"),
250
+ anno::description("Enables the emission of light from the material"),
251
+ anno::in_group("Emissive")
252
+ ]],
253
+ color emission_color = color(1.0,0.1,0.1) [[
254
+ anno::display_name("Emissive Color"),
255
+ anno::description("The emission color"),
256
+ anno::in_group("Emissive"),
257
+ anno::enable_if("enable_emission == true")
258
+ ]],
259
+ float emission_intensity = float(40.0) [[
260
+ anno::display_name("Emissive Intensity"),
261
+ anno::description("Intensity of the emission"),
262
+ anno::in_group("Emissive"),
263
+ anno::enable_if("enable_emission == true")
264
+ ]],
265
+
266
+
267
+ // Geometry Opacity //
268
+
269
+ uniform bool enable_opacity = false [[
270
+ anno::display_name("Enable Opacity"),
271
+ anno::description("Enables the use of cutout opacity"),
272
+ anno::in_group("Opacity")
273
+ ]],
274
+ float geometry_opacity = float(1.0) [[
275
+ anno::display_name("Opacity Amount"),
276
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
277
+ anno::in_group("Opacity"),
278
+ anno::hard_range(float(0.0), float(1.0))
279
+ ]],
280
+ uniform float geometry_opacity_threshold = 0.f
281
+ [[
282
+ anno::hard_range(0.0, 1.0),
283
+ anno::display_name("Opacity Threshold"),
284
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
285
+ anno::in_group("Opacity")
286
+ ]],
287
+
288
+
289
+ // Clearcoat //
290
+
291
+ uniform bool enable_coat = false [[
292
+ anno::display_name("Enable Clearcoat Layer"),
293
+ anno::description("Adds a coat layer on top of the material when enabled"),
294
+ anno::in_group("Clearcoat")
295
+ ]],
296
+ float coat_weight = float(1.0) [[
297
+ anno::display_name("Clearcoat Weight"),
298
+ anno::description("Sets the weight for coat layer"),
299
+ anno::in_group("Clearcoat"),
300
+ anno::hard_range(float(0.0), float(1.0))
301
+ ]],
302
+ color coat_color = color(1.0) [[
303
+ anno::display_name("Clearcoat Tint"),
304
+ anno::description("Clearcoat is tinted and affects the underlying material"),
305
+ anno::in_group("Clearcoat")
306
+ ]],
307
+ float coat_transparency = float(1.0) [[
308
+ anno::display_name("Clearcoat Transparency"),
309
+ anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"),
310
+ anno::in_group("Clearcoat"),
311
+ anno::hard_range(float(0.0), float(1.0))
312
+ ]],
313
+ float coat_roughness = float(0.0) [[
314
+ anno::display_name("Clearcoat Roughness"),
315
+ anno::description("Higher roughness values lead to more blurry reflections"),
316
+ anno::in_group("Clearcoat")
317
+ ]],
318
+ float2 coat_aniso_roughness = float2(0.0, 0.0) [[
319
+ anno::display_name("Clearcoat aniso roughness"),
320
+ anno::description("Higher roughness values lead to more blurry reflections"),
321
+ anno::in_group("Clearcoat"),
322
+ anno::hidden()
323
+ ]],
324
+ float coat_ior = float(1.56) [[
325
+ anno::display_name("Clearcoat IOR"),
326
+ anno::description("Sets the Index of refraction for the coat layer"),
327
+ anno::in_group("Clearcoat"),
328
+ anno::soft_range(float(0.0), float(4.0))
329
+ ]],
330
+ float3 clearcoat_geometry_normal = state::normal() [[
331
+ anno::display_name("Clearcoat Normal"),
332
+ anno::in_group("Clearcoat"),
333
+ anno::usage("normal")
334
+ ]],
335
+
336
+
337
+ // Geometry //
338
+
339
+ float3 geometry_normal = state::normal() [[
340
+ anno::display_name("Geometry Normal"),
341
+ anno::in_group("Geometry"),
342
+ anno::usage("normal")
343
+ ]]
344
+
345
+ )
346
+ [[
347
+ anno::display_name("OmniPBR Base"),
348
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
349
+ anno::in_group("Base"),
350
+ anno::version( 2, 1, 1),
351
+ anno::author("NVIDIA CORPORATION"),
352
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
353
+ ]]
354
+ = let{
355
+
356
+ // Diffuse Bsdf //
357
+
358
+ color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint;
359
+
360
+ color base_color = tinted_diffuse_color;
361
+
362
+ bsdf diffuse_bsdf = df::weighted_layer(
363
+ weight: 1.0,
364
+ layer: df::diffuse_reflection_bsdf(
365
+ tint: base_color,
366
+ roughness: float(0.0)
367
+ ),
368
+ base: bsdf(),
369
+ normal: enable_coat ? geometry_normal : state::normal()
370
+ );
371
+
372
+ // Glossy Reflection Bsdf //
373
+
374
+ float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness
375
+ + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1);
376
+ float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness
377
+ + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1);
378
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
379
+ roughness_u: roughness_u,
380
+ roughness_v: roughness_v,
381
+ tint: color(1.0),
382
+ mode: df::scatter_reflect
383
+ );
384
+
385
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
386
+ normal_reflectivity: 0.08,
387
+ grazing_reflectivity: 1.0,
388
+ exponent: 5.0,
389
+ weight: specular_level,
390
+ layer: ggx_smith_bsdf,
391
+ base: diffuse_bsdf,
392
+ normal: enable_coat ? geometry_normal : state::normal()
393
+ );
394
+
395
+ bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
396
+
397
+ bsdf omni_PBR_bsdf = df::weighted_layer(
398
+ weight: metalness,
399
+ layer: directional_factor_bsdf,
400
+ base: custom_curve_layer_bsdf,
401
+ normal: enable_coat ? geometry_normal : state::normal()
402
+ );
403
+
404
+ // Clear Coat //
405
+
406
+ float coat_roughness_u = math::clamp(coat_roughness * coat_roughness
407
+ + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1);
408
+ float coat_roughness_v = math::clamp(coat_roughness * coat_roughness
409
+ + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1);
410
+ bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf(
411
+ roughness_u: coat_roughness_u,
412
+ roughness_v: coat_roughness_v,
413
+ tint: color(1.0),
414
+ mode: df::scatter_reflect
415
+ );
416
+
417
+ bsdf opaque_coat = df::weighted_layer(
418
+ weight: coat_transparency,
419
+ layer: ::df::tint(
420
+ tint: coat_color,
421
+ base: omni_PBR_bsdf
422
+ ),
423
+ base: ::df::diffuse_reflection_bsdf(
424
+ tint: coat_color
425
+ )
426
+ );
427
+
428
+ bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
429
+ ior: coat_ior,
430
+ weight: coat_weight,
431
+ layer: coat_bsdf,
432
+ base: opaque_coat,
433
+ normal: clearcoat_geometry_normal
434
+ );
435
+
436
+ bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
437
+
438
+ color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0);
439
+
440
+ float opacity_value = geometry_opacity;
441
+ float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0;
442
+
443
+ material_emission emission = material_emission(
444
+ df::diffuse_edf(),
445
+ intensity: emission_value
446
+ );
447
+
448
+ material_surface surface = material_surface(
449
+ scattering: final_bsdf,
450
+ emission: emission
451
+ );
452
+
453
+ material_geometry geometry = material_geometry(
454
+ normal: enable_coat ? state::normal(): geometry_normal,
455
+ cutout_opacity: cutout_opacity
456
+ );
457
+
458
+ } in material(
459
+ surface: surface,
460
+ geometry: geometry
461
+ );
saved/assets/_dependencies/public_validation/materials/OmniPBR_ClearCoat.mdl ADDED
@@ -0,0 +1,707 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::anno::*;
38
+
39
+ import ::debug::*;
40
+
41
+ import ::nvidia::core_definitions::file_texture;
42
+ import ::nvidia::core_definitions::normalmap_texture;
43
+
44
+ import OmniPBRBase_1::*;
45
+
46
+ // Functions //
47
+
48
+
49
+ // Returns a matrix from R,T,S. inputs //
50
+
51
+ uniform float4x4 rotation_translation_scale(
52
+ uniform float3 rotation = float3(0.)
53
+ [[ anno::description("Rotation applied to every UVW coordinate") ]],
54
+ uniform float3 translation = float3(0.)
55
+ [[ anno::description("Offset applied to every UVW coordinate") ]],
56
+ uniform float3 scaling = float3(1.)
57
+ [[ anno::description("Scale applied to every UVW coordinate") ]]
58
+ )
59
+ [[
60
+ anno::description("Construct a transformation matrix from euler rotation, translation and scale"),
61
+ anno::hidden()
62
+ ]]
63
+ {
64
+ float4x4 scale =
65
+ float4x4(scaling.x , 0.0 , 0.0 , 0.0,
66
+ 0.0 , scaling.y , 0.0 , 0.0,
67
+ 0.0 , 0.0 , scaling.z , 0.0,
68
+ translation.x , translation.y , translation.z , 1.0);
69
+
70
+ float3 s = math::sin(rotation);
71
+ float3 c = math::cos(rotation);
72
+
73
+ float4x4 rotate =
74
+ 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,
75
+ 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,
76
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
77
+ 0.0 , 0.0 , 0 , 1.0);
78
+
79
+ return scale * rotate;
80
+ }
81
+
82
+ // Returns the normal n in tangent space, given n is in internal space. //
83
+
84
+ float3 transform_internal_to_tangent(float3 n)
85
+ {
86
+ /* flip_tangent_v */
87
+ return
88
+ n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+
89
+ n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+
90
+ n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z);
91
+ }
92
+
93
+ // Returns the normal n in internal space, given n is in tangent space.
94
+ float3 transform_tangent_to_internal(float3 n)
95
+ {
96
+ return state::texture_tangent_u(0) * n.x -
97
+ state::texture_tangent_v(0) * n.y + /* flip_tangent_v */
98
+ state::normal() * n.z;
99
+ }
100
+
101
+ // Returns a normal by adding a detail normal to a global normal.
102
+ export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
103
+ {
104
+ // http://blog.selfshadow.com/publications/blending-in-detail/
105
+ float3 n_t = transform_internal_to_tangent(n);
106
+ float3 nd_t = transform_internal_to_tangent(nd);
107
+ n_t = n_t + float3(0.,0.,1.);
108
+ nd_t = nd_t * float3(-1.,-1.,1.);
109
+ n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t;
110
+ return math::normalize(transform_tangent_to_internal(n));
111
+ }
112
+
113
+ base::texture_return multiply_colors(
114
+ color color_1 = color(1.0, 1.0, 1.0),
115
+ color color_2 = color(.5, .5, .5),
116
+ float weight = 1.0
117
+ )
118
+ [[
119
+ anno::hidden()
120
+ ]]
121
+ {
122
+ return base::blend_color_layers(
123
+ layers: base::color_layer[](
124
+ base::color_layer(
125
+ layer_color: color_2,
126
+ weight: weight,
127
+ mode: base::color_layer_multiply
128
+ )),
129
+ base: color_1
130
+ );
131
+ }
132
+
133
+
134
+ // OmniPBR Clearcoat //
135
+
136
+ export material OmniPBR_ClearCoat(
137
+
138
+ // Albdeo //
139
+
140
+ color diffuse_color_constant = color(0.2) [[
141
+ anno::display_name("Albedo Color"),
142
+ anno::description("This is the albedo base color"),
143
+ anno::in_group("Albedo")
144
+ ]],
145
+ uniform texture_2d diffuse_texture = texture_2d() [[
146
+ anno::display_name("Albedo Map"),
147
+ anno::in_group("Albedo")
148
+ ]],
149
+ float albedo_desaturation = float(0.0) [[
150
+ anno::display_name("Albedo Desaturation"),
151
+ anno::description("Desaturates the diffuse color"),
152
+ anno::in_group("Albedo"),
153
+ anno::soft_range(float(0.0), float(1.0))
154
+ ]],
155
+ float albedo_add = float(0.0) [[
156
+ anno::display_name("Albedo Add"),
157
+ anno::description("Adds a constant value to the diffuse color "),
158
+ anno::in_group("Albedo"),
159
+ anno::soft_range(float(-1.0), float(1.0))
160
+ ]],
161
+ float albedo_brightness = float(1.0) [[
162
+ anno::display_name("Albedo Brightness"),
163
+ anno::description("Multiplier for the diffuse color "),
164
+ anno::in_group("Albedo"),
165
+ anno::soft_range(float(0.0), float(1.0))
166
+ ]],
167
+ color diffuse_tint = color(1.0) [[
168
+ anno::display_name("Color Tint"),
169
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
170
+ anno::in_group("Albedo")
171
+ ]],
172
+
173
+
174
+ // Reflectivity //
175
+
176
+ float reflection_roughness_constant = float(0.5) [[
177
+ anno::display_name("Roughness Amount"),
178
+ anno::description("Higher roughness values lead to more blurry reflections"),
179
+ anno::in_group("Reflectivity"),
180
+ anno::hard_range(float(0.0), float(1.0))
181
+ ]],
182
+ float reflection_roughness_texture_influence = float(0.0) [[
183
+ anno::display_name("Roughness Map Influence"),
184
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
185
+ anno::in_group("Reflectivity"),
186
+ anno::hard_range(float(0.0), float(1.0))
187
+ ]],
188
+ uniform texture_2d reflectionroughness_texture = texture_2d() [[
189
+ anno::display_name("Roughness Map"),
190
+ anno::in_group("Reflectivity"),
191
+ anno::usage("roughness")
192
+ ]],
193
+ float metallic_constant = float(0.0) [[
194
+ anno::display_name("Metallic Amount"),
195
+ anno::description("Metallic Material"),
196
+ anno::in_group("Reflectivity"),
197
+ anno::hard_range(float(0.0), float(1.0))
198
+ ]],
199
+ float metallic_texture_influence = float(0.0) [[
200
+ anno::display_name("Metallic Map Influence"),
201
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
202
+ anno::in_group("Reflectivity"),
203
+ anno::hard_range(float(0.0), float(1.0))
204
+ ]],
205
+ uniform texture_2d metallic_texture = texture_2d() [[
206
+ anno::display_name("Metallic Map"),
207
+ anno::in_group("Reflectivity"),
208
+ anno::usage("metalness")
209
+ ]],
210
+ float specular_level = float(0.5) [[
211
+ anno::display_name("Specular"),
212
+ anno::description("The specular level (intensity) of the material"),
213
+ anno::in_group("Reflectivity"),
214
+ anno::soft_range(float(0.0), float(1.0))
215
+ ]],
216
+
217
+
218
+ // ORM //
219
+
220
+ uniform bool enable_ORM_texture = false [[
221
+ anno::display_name("Enable ORM Texture"),
222
+ anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
223
+ anno::in_group("Reflectivity")
224
+ ]],
225
+ uniform texture_2d ORM_texture = texture_2d() [[
226
+ anno::display_name("ORM Map"),
227
+ anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
228
+ anno::in_group("Reflectivity"),
229
+ anno::usage("roughness")
230
+ ]],
231
+
232
+
233
+ // AO Group //
234
+
235
+ float ao_to_diffuse = 0.0 [[
236
+ anno::display_name("AO to diffuse"),
237
+ anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
238
+ anno::in_group("AO"),
239
+ anno::hard_range(float(0.0), float(1.0))
240
+ ]],
241
+ uniform texture_2d ao_texture = texture_2d() [[
242
+ anno::display_name("Ambient Occlusion Map"),
243
+ anno::description("The ambient occlusion texture for the material"),
244
+ anno::in_group("AO"),
245
+ anno::usage("occlusion")
246
+ ]],
247
+
248
+
249
+ // Emission //
250
+
251
+ uniform bool enable_emission = false [[
252
+ anno::display_name("Enable Emission"),
253
+ anno::description("Enables the emission of light from the material"),
254
+ anno::in_group("Emissive")
255
+ ]],
256
+ color emissive_color = color(1.0,0.1,0.1) [[
257
+ anno::display_name("Emissive Color"),
258
+ anno::description("The emission color"),
259
+ anno::in_group("Emissive"),
260
+ anno::enable_if("enable_emission == true")
261
+ ]],
262
+ uniform texture_2d emissive_color_texture = texture_2d() [[
263
+ anno::display_name("Emissive Color map"),
264
+ anno::in_group("Emissive"),
265
+ anno::description("The emissive color texture"),
266
+ anno::enable_if("enable_emission == true")
267
+ ]],
268
+ uniform texture_2d emissive_mask_texture = texture_2d() [[
269
+ anno::display_name("Emissive Mask map"),
270
+ anno::description("The texture masking the emissive color"),
271
+ anno::in_group("Emissive"),
272
+ anno::enable_if("enable_emission == true"),
273
+ anno::usage("occlusion")
274
+ ]],
275
+ float emissive_intensity = float(40.0) [[
276
+ anno::display_name("Emissive Intensity"),
277
+ anno::description("Intensity of the emission"),
278
+ anno::in_group("Emissive"),
279
+ anno::enable_if("enable_emission == true")
280
+ ]],
281
+
282
+
283
+ // Cutout Opacity //
284
+
285
+ uniform bool enable_opacity = false [[
286
+ anno::display_name("Enable Opacity"),
287
+ anno::description("Enables the use of cutout opacity"),
288
+ anno::in_group("Opacity")
289
+ ]],
290
+ uniform texture_2d opacity_texture = texture_2d() [[
291
+ anno::display_name("Opacity Map"),
292
+ anno::in_group("Opacity"),
293
+ anno::usage("opacity")
294
+ ]],
295
+ float opacity_constant = float(1.0) [[
296
+ anno::display_name("Opacity Amount"),
297
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
298
+ anno::in_group("Opacity"),
299
+ anno::hard_range(float(0.0), float(1.0))
300
+ ]],
301
+ uniform bool enable_opacity_texture = false [[
302
+ anno::display_name("Enable Opacity Texture"),
303
+ anno::description("Enables or disables the usage of the opacity texture map"),
304
+ anno::in_group("Opacity")
305
+ ]],
306
+ uniform base::mono_mode opacity_mode = base::mono_average [[
307
+ anno::display_name("Opacity Mono Source"),
308
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
309
+ anno::in_group("Opacity")
310
+ ]],
311
+ uniform float opacity_threshold = float(0.0) [[
312
+ anno::display_name("Opacity Threshold"),
313
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
314
+ anno::in_group("Opacity"),
315
+ anno::hard_range(float(0.0), float(1.0))
316
+ ]],
317
+
318
+
319
+ // Clearcoat //
320
+
321
+ uniform bool enable_clearcoat = false [[
322
+ anno::display_name("Enable Clearcoat Layer"),
323
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
324
+ anno::in_group("Clearcoat")
325
+ ]],
326
+ float clearcoat_weight = float(1.0) [[
327
+ anno::display_name("Clearcoat Weight"),
328
+ anno::description("Sets the weight for clearcoat layer"),
329
+ anno::in_group("Clearcoat"),
330
+ anno::hard_range(float(0.0), float(1.0))
331
+ ]],
332
+ color clearcoat_tint = color(1.0) [[
333
+ anno::display_name("Clearcoat Tint"),
334
+ anno::description("Clearcoat is tinted and affects the underlying material"),
335
+ anno::in_group("Clearcoat")
336
+ ]],
337
+ float clearcoat_transparency = float(1.0) [[
338
+ anno::display_name("Clearcoat Transparency"),
339
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"),
340
+ anno::in_group("Clearcoat"),
341
+ anno::hard_range(float(0.0), float(1.0))
342
+ ]],
343
+ float clearcoat_reflection_roughness = float(0.0) [[
344
+ anno::display_name("Clearcoat Roughness"),
345
+ anno::description("Higher roughness values lead to more blurry reflections"),
346
+ anno::in_group("Clearcoat"),
347
+ anno::hard_range(float(0.0), float(1.0))
348
+ ]],
349
+ float clearcoat_ior = float(1.56) [[
350
+ anno::display_name("Clearcoat IOR"),
351
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
352
+ anno::in_group("Clearcoat"),
353
+ anno::soft_range(float(0.0), float(4.0))
354
+ ]],
355
+ uniform float clearcoat_bump_factor = float(1.0) [[
356
+ anno::display_name("Clearcoat Normal Map Strength"),
357
+ anno::description("Strength of normal map."),
358
+ anno::in_group("Clearcoat"),
359
+ anno::soft_range(float(0.0), float(1.0))
360
+ ]],
361
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[
362
+ anno::display_name("Clearcoat Normal Map"),
363
+ anno::description("Enables the usage of the normalmap texture"),
364
+ anno::in_group("Clearcoat"),
365
+ anno::usage("normal")
366
+ ]],
367
+ uniform float2 clearcoat_texture_translate = float2(0.0) [[
368
+ anno::display_name("Clearcoat Texture Translate"),
369
+ anno::description("Controls the position of the clearcoat texture"),
370
+ anno::ui_order(1),
371
+ anno::in_group("UV")
372
+ ]],
373
+ uniform float clearcoat_texture_rotate = float(0.0) [[
374
+ anno::display_name("Clearcoat Texture Rotate"),
375
+ anno::description("Rotates angle of the clearcoat texture in degrees"),
376
+ anno::ui_order(2),
377
+ anno::in_group("UV")
378
+ ]],
379
+ uniform float2 clearcoat_texture_scale = float2(1.0) [[
380
+ anno::display_name("Clearcoat Texture Tiling"),
381
+ anno::description("Controls the repetition of the clearcoat texture"),
382
+ anno::ui_order(3),
383
+ anno::in_group("UV")
384
+ ]],
385
+ float clearcoat_flatten = float(1.0) [[
386
+ anno::display_name("Clearcoat Flatten"),
387
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
388
+ anno::in_group("Clearcoat"),
389
+ anno::hard_range(float(0.0), float(1.0))
390
+ ]],
391
+
392
+
393
+ // Normal //
394
+
395
+ uniform float geometry_normal_roughness_strength = 1.f
396
+ [[
397
+ anno::hard_range(0.0, 1.0),
398
+ anno::display_name("Normal map to roughness weight"),
399
+ anno::description("Enables and weights roughness induced by normal maps"),
400
+ anno::in_group("Normal")
401
+ ]],
402
+ uniform float bump_factor = float(1.0) [[
403
+ anno::display_name("Normal Strength"),
404
+ anno::description("Strength of normal map"),
405
+ anno::in_group("Normal"),
406
+ anno::soft_range(float(0.0), float(1.0))
407
+ ]],
408
+ uniform texture_2d normalmap_texture = texture_2d() [[
409
+ anno::display_name("Normal Map"),
410
+ anno::in_group("Normal"),
411
+ anno::usage("normal")
412
+ ]],
413
+ uniform float detail_bump_factor = float(0.3) [[
414
+ anno::display_name("Detail Normal Strength"),
415
+ anno::in_group("Normal"),
416
+ anno::description("Strength of the detail normal"),
417
+ anno::soft_range(float(0.0), float(1.0))
418
+ ]],
419
+ uniform texture_2d detail_normalmap_texture = texture_2d() [[
420
+ anno::display_name("Detail Normal Map"),
421
+ anno::in_group("Normal"),
422
+ anno::usage("normal")
423
+ ]],
424
+ uniform bool flip_tangent_u = false [[
425
+ anno::display_name("Normal Map Flip U Tangent"),
426
+ anno::in_group("Normal")
427
+ ]],
428
+ uniform bool flip_tangent_v = true [[
429
+ anno::display_name("Normal Map Flip V Tangent"),
430
+ anno::in_group("Normal")
431
+ ]],
432
+
433
+
434
+ // UVW Projection Group //
435
+
436
+ uniform bool project_uvw = false [[
437
+ anno::display_name("Enable Project UVW Coordinates"),
438
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
439
+ anno::in_group("UV")
440
+ ]],
441
+ uniform bool world_or_object = false [[
442
+ anno::display_name("Enable World Space"),
443
+ anno::description("When enabled, uses world space for projection, otherwise object space is used"),
444
+ anno::in_group("UV"),
445
+ anno::enable_if("project_uvw == true")
446
+ ]],
447
+ uniform int uv_space_index = 0 [[
448
+ anno::display_name("UV Space Index"),
449
+ anno::description("UV Space Index"),
450
+ anno::in_group("UV"),
451
+ anno::enable_if("project_uvw == true"),
452
+ anno::hard_range(int(0), int(3))
453
+ ]],
454
+
455
+ // UVW Adjustments Group //
456
+
457
+ uniform float2 texture_translate = float2(0.0) [[
458
+ anno::display_name("Texture Translate"),
459
+ anno::description("Controls position of texture."),
460
+ anno::in_group("UV"),
461
+ anno::enable_if("project_uvw == true")
462
+ ]],
463
+ uniform float texture_rotate = float(0.0) [[
464
+ anno::display_name("Texture Rotate"),
465
+ anno::description("Rotates angle of texture in degrees."),
466
+ anno::in_group("UV"),
467
+ anno::enable_if("project_uvw == true")
468
+ ]],
469
+ uniform float2 texture_scale = float2(1.0) [[
470
+ anno::display_name("Texture Tiling"),
471
+ anno::description("Controls repetition of the texture."),
472
+ anno::in_group("UV"),
473
+ anno::enable_if("project_uvw == true")
474
+ ]],
475
+ uniform float2 detail_texture_translate = float2(0.0) [[
476
+ anno::display_name("Detail Texture Translate"),
477
+ anno::description("Controls the position of the detail texture."),
478
+ anno::in_group("UV"),
479
+ anno::enable_if("project_uvw == true")
480
+ ]],
481
+ uniform float detail_texture_rotate = float(0.0) [[
482
+ anno::display_name("Detail Texture Rotate"),
483
+ anno::description("Rotates angle of the detail texture in degrees."),
484
+ anno::in_group("UV"),
485
+ anno::enable_if("project_uvw == true")
486
+ ]],
487
+ uniform float2 detail_texture_scale = float2(1.0) [[
488
+ anno::display_name("Detail Texture Tiling"),
489
+ anno::description("Controls repetition of the detail texture."),
490
+ anno::in_group("UV"),
491
+ anno::enable_if("project_uvw == true")
492
+ ]]
493
+ )
494
+ [[
495
+ anno::display_name("OmniPBR ClearCoat "),
496
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
497
+ anno::in_group("Base"),
498
+ anno::version( 2, 1, 1),
499
+ anno::author("NVIDIA CORPORATION"),
500
+ anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic"))
501
+ ]] = let {
502
+
503
+ // UVW lookup and transformation //
504
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
505
+
506
+ base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection(
507
+ coordinate_system: the_system,
508
+ texture_space: uv_space_index,
509
+ projection_type: base::projection_cubic
510
+ ) :
511
+ base::coordinate_source(
512
+ coordinate_system: base::texture_coordinate_uvw,
513
+ texture_space: uv_space_index
514
+ );
515
+
516
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
517
+ transform: rotation_translation_scale(
518
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
519
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
520
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
521
+ ),
522
+ coordinate: uvw
523
+ );
524
+
525
+ base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate(
526
+ transform: rotation_translation_scale(
527
+ scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0),
528
+ rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ),
529
+ translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0)
530
+ ),
531
+ coordinate: uvw
532
+ );
533
+
534
+ base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate(
535
+ transform: rotation_translation_scale(
536
+ scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0),
537
+ rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ),
538
+ translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f)
539
+ ),
540
+ coordinate: uvw
541
+ );
542
+
543
+ // Normal calculations //
544
+ OmniPBRBase_1::NormalData defaultData = OmniPBRBase_1::NormalData(state::normal(), float2(0));
545
+
546
+ OmniPBRBase_1::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ?
547
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
548
+ texture: normalmap_texture,
549
+ factor: bump_factor,
550
+ uvw: transformed_uvw,
551
+ flip_tangent_u: flip_tangent_u,
552
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
553
+ //flip_tangent_v: true
554
+
555
+ ) : defaultData;
556
+ float3 the_normal = normal_data.normal;
557
+
558
+ OmniPBRBase_1::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ?
559
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
560
+ texture: detail_normalmap_texture,
561
+ factor: detail_bump_factor,
562
+ uvw: detail_transformed_uvw,
563
+ flip_tangent_u: flip_tangent_u,
564
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
565
+ ) : defaultData;
566
+ float3 detail_normal = detail_normal_data.normal;
567
+
568
+ OmniPBRBase_1::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ?
569
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
570
+ texture: clearcoat_normalmap_texture,
571
+ factor: clearcoat_bump_factor,
572
+ uvw: clearcoat_transformed_uvw,
573
+ flip_tangent_u: flip_tangent_u,
574
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
575
+ ) : defaultData;
576
+ float3 clearcoat_normal = clearcoat_normal_data.normal;
577
+
578
+
579
+ float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal;
580
+ float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten);
581
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal)
582
+ : flattened_clearcoat_normal;
583
+
584
+
585
+ // ORM Handling //
586
+
587
+ float3 ORM_lookup = tex::lookup_float3(
588
+ tex: ORM_texture,
589
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
590
+ );
591
+
592
+
593
+ float3 roughness_lookup = tex::lookup_float3(
594
+ tex: reflectionroughness_texture,
595
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
596
+ );
597
+
598
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x;
599
+ float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
600
+ float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)),
601
+ math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y)));
602
+
603
+ 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)),
604
+ math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y)));
605
+
606
+ // Diffuse Color Lookup and AO //
607
+
608
+ base::texture_return base_lookup = base::file_texture(
609
+ texture: diffuse_texture,
610
+ color_offset: color(albedo_add),
611
+ color_scale: color(albedo_brightness),
612
+ mono_source: base::mono_luminance,
613
+ uvw: transformed_uvw,
614
+ clip: false
615
+ );
616
+
617
+ base::texture_return ao_lookup = base::file_texture(
618
+ texture: ao_texture,
619
+ color_offset: color(0.0, 0.0, 0.0),
620
+ color_scale: color(1.0, 1.0, 1.0),
621
+ mono_source: base::mono_average,
622
+ uvw: transformed_uvw,
623
+ clip: false
624
+ );
625
+
626
+
627
+ color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint;
628
+ color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation);
629
+ color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant;
630
+ color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint;
631
+
632
+ color base_color = multiply_colors(
633
+ color_1: tinted_diffuse,
634
+ color_2: ao_color,
635
+ weight: ao_to_diffuse
636
+ ).tint;
637
+
638
+
639
+ // Metalness //
640
+
641
+ float3 metallic_lookup = tex::lookup_float3(
642
+ tex: metallic_texture,
643
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
644
+ );
645
+
646
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x;
647
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
648
+
649
+
650
+ // Emission //
651
+
652
+ color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ?
653
+ base::file_texture(
654
+ texture: emissive_color_texture,
655
+ color_offset: color(0.0, 0.0, 0.0),
656
+ color_scale: color(1.0, 1.0, 1.0),
657
+ mono_source: base::mono_average,
658
+ uvw: transformed_uvw,
659
+ clip: false
660
+ ).tint : emissive_color;
661
+
662
+ color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ?
663
+ base::file_texture(
664
+ texture: emissive_mask_texture,
665
+ color_offset: color(0.0, 0.0, 0.0),
666
+ color_scale: color(1.0, 1.0, 1.0),
667
+ mono_source: base::mono_average,
668
+ uvw: transformed_uvw,
669
+ clip: false
670
+ ).tint : color(1.0);
671
+
672
+ color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0);
673
+
674
+ // Opacity //
675
+
676
+ float opacity_value = enable_opacity_texture ? base::file_texture(
677
+ texture: opacity_texture,
678
+ mono_source: opacity_mode,
679
+ uvw: transformed_uvw
680
+ ).mono : opacity_constant;
681
+
682
+ float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
683
+
684
+ material base = OmniPBRBase_1::OmniPBRBase(
685
+ diffuse_reflection_color: base_color,
686
+ specular_reflection_aniso_roughness: reflection_roughness,
687
+ specular_level: specular_level,
688
+ metalness: metallic,
689
+ enable_emission: enable_emission,
690
+ emission_color: final_emission_color,
691
+ emission_intensity: emissive_intensity,
692
+ enable_coat: enable_clearcoat,
693
+ coat_weight: clearcoat_weight,
694
+ coat_color: clearcoat_tint,
695
+ coat_transparency: clearcoat_transparency,
696
+ coat_aniso_roughness: clearcoat_reflection_roughness2,
697
+ coat_ior: clearcoat_ior,
698
+ enable_opacity: enable_opacity,
699
+ geometry_opacity: cutout_opacity,
700
+ clearcoat_geometry_normal: final_clearcoat_normal,
701
+ geometry_normal: diffuse_gloss_normal
702
+ );
703
+
704
+ } in material(
705
+ surface: base.surface,
706
+ geometry: base.geometry
707
+ );
saved/assets/_dependencies/public_validation/materials/OmniPBR_ClearCoat_Opacity.mdl ADDED
@@ -0,0 +1,884 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+
30
+ mdl 1.7;
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::tex::*;
36
+ import ::anno::*;
37
+
38
+ import ::nvidia::core_definitions::file_texture;
39
+ import ::nvidia::core_definitions::normalmap_texture;
40
+
41
+ import OmniPBRBase_1::*;
42
+
43
+
44
+ uniform float4x4 rotation_translation_scale(
45
+ uniform float3 rotation = float3(0.)
46
+ [[ anno::description("Rotation applied to every UVW coordinate") ]],
47
+ uniform float3 translation = float3(0.)
48
+ [[ anno::description("Offset applied to every UVW coordinate") ]],
49
+ uniform float3 scaling = float3(1.)
50
+ [[ anno::description("Scale applied to every UVW coordinate") ]]
51
+ )
52
+ [[
53
+ anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
54
+ anno::hidden()
55
+ ]]
56
+ {
57
+ float4x4 scale =
58
+ float4x4(scaling.x , 0. , 0. , 0.,
59
+ 0. , scaling.y , 0. , 0.,
60
+ 0. , 0. , scaling.z , 0.,
61
+ translation.x, translation.y, translation.z, 1.);
62
+
63
+ float3 s = math::sin(rotation);
64
+ float3 c = math::cos(rotation);
65
+ float4x4 rotate =
66
+ 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,
67
+ 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,
68
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
69
+ 0. , 0 , 0 , 1.);
70
+
71
+ return scale*rotate;
72
+ }
73
+
74
+ // Returns the normal n in tangent space, given n is in internal space.
75
+ float3 transform_internal_to_tangent(float3 n)
76
+ {
77
+ /* flip_tangent_v */
78
+ return
79
+ n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+
80
+ n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+
81
+ n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z);
82
+ }
83
+
84
+ // Returns the normal n in internal space, given n is in tangent space.
85
+ float3 transform_tangent_to_internal(float3 n)
86
+ {
87
+ return state::texture_tangent_u(0) * n.x -
88
+ state::texture_tangent_v(0) * n.y + /* flip_tangent_v */
89
+ state::normal() * n.z ;
90
+ }
91
+
92
+ // Returns a normal by adding a detail normal to a global normal.
93
+ export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
94
+ {
95
+ // http://blog.selfshadow.com/publications/blending-in-detail/
96
+ float3 n_t = transform_internal_to_tangent(n);
97
+ float3 nd_t = transform_internal_to_tangent(nd);
98
+
99
+ n_t=n_t + float3(0.,0.,1.);
100
+ nd_t = nd_t * float3(-1.,-1.,1.);
101
+
102
+ n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t;
103
+ return math::normalize(transform_tangent_to_internal(n));
104
+ }
105
+
106
+
107
+ base::texture_return multiply_colors(
108
+ color color_1 = color(1.0, 1.0, 1.0),
109
+ color color_2 = color(.5, .5, .5),
110
+ float weight = 1.0
111
+ ) [[
112
+ anno::hidden()
113
+ ]]
114
+ {
115
+ return base::blend_color_layers(
116
+ layers: base::color_layer[](
117
+ base::color_layer(
118
+ layer_color: color_2,
119
+ weight: weight,
120
+ mode: base::color_layer_multiply
121
+ )),
122
+ base: color_1
123
+ );
124
+ }
125
+
126
+
127
+ base::texture_return add_colors(
128
+ color color_1 = color(.5, .5, .5),
129
+ color color_2 = color(.5, .5, .5),
130
+ float weight = 1.0
131
+ ) [[
132
+ anno::hidden(),
133
+ anno::unused()
134
+ ]]
135
+ {
136
+ return base::blend_color_layers(
137
+ layers: base::color_layer[](
138
+ base::color_layer(
139
+ layer_color: color_2,
140
+ weight: weight,
141
+ mode: base::color_layer_add
142
+ )),
143
+ base: color_1
144
+ );
145
+ }
146
+
147
+ base::texture_return blend_colors(
148
+ color color_1 = color(1.0, 1.0, 1.0),
149
+ color color_2 = color(.5, .5, .5),
150
+ float weight = 1.0
151
+ ) [[
152
+ anno::hidden(),
153
+ anno::unused()
154
+ ]]
155
+ {
156
+ return base::blend_color_layers(
157
+ layers: base::color_layer[](
158
+ base::color_layer(
159
+ layer_color: color_2,
160
+ weight: weight,
161
+ mode: base::color_layer_blend
162
+ )),
163
+ base: color_1
164
+ );
165
+ }
166
+
167
+
168
+ export material OmniPBR_ClearCoat_Opacity(
169
+
170
+ color diffuse_color_constant = color(0.2f)
171
+ [[
172
+ anno::display_name("Base Color"),
173
+ anno::description("This is the base color"),
174
+ anno::in_group("Albedo")
175
+ ]],
176
+ uniform texture_2d diffuse_texture = texture_2d()
177
+ [[
178
+ anno::display_name("Albedo Map"),
179
+ anno::in_group("Albedo")
180
+ ]],
181
+ float albedo_desaturation = float(0.0)
182
+ [[
183
+ anno::display_name("Albedo Desaturation"),
184
+ anno::soft_range(float(0.0f), float(1.0f)),
185
+ anno::description("Desaturates the diffuse color"),
186
+ anno::in_group("Albedo")
187
+ ]],
188
+ float albedo_add = float(0.0)
189
+ [[
190
+ anno::display_name("Albedo Add"),
191
+ anno::soft_range(float(-1.0f), float(1.0f)),
192
+ anno::description("Adds a constant value to the diffuse color "),
193
+ anno::in_group("Albedo")
194
+ ]],
195
+ float albedo_brightness = float(1.0)
196
+ [[
197
+ anno::display_name("Albedo Brightness"),
198
+ anno::soft_range(float(0.0f), float(1.0f)),
199
+ anno::description("Multiplier for the diffuse color "),
200
+ anno::in_group("Albedo")
201
+ ]],
202
+ color diffuse_tint = color(1.0f)
203
+ [[
204
+ anno::display_name("Color Tint"),
205
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
206
+ anno::in_group("Albedo")
207
+ ]],
208
+
209
+
210
+ // -------------------- REFLECTIVITY ----------------------
211
+
212
+
213
+
214
+ float reflection_roughness_constant = 0.5f
215
+ [[
216
+ anno::display_name("Roughness Amount"),
217
+ anno::hard_range(0.0,1.),
218
+ anno::description("Higher roughness values lead to more blurry reflections"),
219
+ anno::in_group("Reflectivity")
220
+ ]],
221
+ float reflection_roughness_texture_influence = 0.0f
222
+ [[
223
+ anno::display_name("Roughness Map Influence"),
224
+ anno::hard_range(0.0, 1.),
225
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
226
+ anno::in_group("Reflectivity")
227
+ ]],
228
+ uniform texture_2d reflectionroughness_texture = texture_2d()
229
+ [[
230
+ anno::display_name("Roughness Map"),
231
+ anno::in_group("Reflectivity")
232
+ ]],
233
+
234
+
235
+ float metallic_constant = 0.f
236
+ [[
237
+ anno::display_name("Metallic Amount"),
238
+ anno::hard_range(0.0,1.),
239
+ anno::description("Metallic Material"),
240
+ anno::in_group("Reflectivity")
241
+ ]],
242
+ float metallic_texture_influence = 0.0f
243
+ [[
244
+ anno::display_name("Metallic Map Influence"),
245
+ anno::hard_range(0.0, 1.),
246
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
247
+ anno::in_group("Reflectivity")
248
+ ]],
249
+ uniform texture_2d metallic_texture = texture_2d()
250
+ [[
251
+ anno::display_name("Metallic Map"),
252
+ anno::in_group("Reflectivity")
253
+ ]],
254
+ float specular_level = float(0.5)
255
+ [[
256
+ anno::display_name("Specular"),
257
+ anno::soft_range(float(0.0f), float(1.0f)),
258
+ anno::description("The specular level (intensity) of the material"),
259
+ anno::in_group("Reflectivity")
260
+ ]],
261
+ // -------------------- ORM ----------------------
262
+ uniform bool enable_ORM_texture = false
263
+ [[
264
+ anno::display_name("Enable ORM Texture"),
265
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
266
+ anno::in_group("Reflectivity")
267
+ ]],
268
+ uniform texture_2d ORM_texture = texture_2d()
269
+ [[
270
+ anno::display_name("ORM Map"),
271
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
272
+ anno::in_group("Reflectivity")
273
+ ]],
274
+
275
+ // -------------------- AO Group ----------------------
276
+
277
+ float ao_to_diffuse = 0.0
278
+ [[
279
+ anno::display_name("AO to Diffuse"),
280
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
281
+ anno::in_group("AO"),
282
+ anno::hard_range(0.0f, 1.0f)
283
+ ]],
284
+ uniform texture_2d ao_texture = texture_2d()
285
+ [[
286
+ anno::display_name("Ambient Occlusion Map"),
287
+ anno::description("The Ambient Occlusion texture for the material"),
288
+ anno::in_group("AO")
289
+ ]],
290
+
291
+
292
+ // -------------------- EMISSIVE ----------------------
293
+
294
+
295
+ uniform bool enable_emission = false
296
+ [[
297
+ anno::display_name("Enable Emission"),
298
+ anno::description("Enables the emission of light from the material"),
299
+ anno::in_group("Emissive")
300
+ ]],
301
+
302
+ color emissive_color = color(1.0, 0.1, 0.1)
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Color"),
306
+ anno::description("The emission color"),
307
+ anno::in_group("Emissive")
308
+
309
+ ]],
310
+
311
+ uniform texture_2d emissive_color_texture = texture_2d()
312
+ [[
313
+ anno::enable_if("enable_emission == true"),
314
+ anno::display_name("Emissive Color map"),
315
+ anno::in_group("Emissive"),
316
+ anno::description("The emissive color texture")
317
+ ]],
318
+
319
+ uniform texture_2d emissive_mask_texture = texture_2d()
320
+ [[
321
+ anno::enable_if("enable_emission == true"),
322
+ anno::display_name("Emissive Mask map"),
323
+ anno::description("The texture masking the emissive color"),
324
+ anno::in_group("Emissive")
325
+ ]],
326
+ uniform float emissive_intensity = 40.f
327
+ [[
328
+ anno::enable_if("enable_emission == true"),
329
+ anno::display_name("Emissive Intensity"),
330
+ anno::description("Intensity of the emission"),
331
+ anno::in_group("Emissive")
332
+ ]],
333
+
334
+ // Cutout Opacity
335
+ uniform bool enable_opacity = true
336
+ [[
337
+ anno::display_name("Enable Opacity"),
338
+ anno::description("Enables the use of cutout opacity"),
339
+ anno::in_group("Opacity")
340
+ ]],
341
+ uniform bool enable_opacity_texture = false
342
+ [[
343
+ anno::display_name("Enable Opacity Texture"),
344
+ anno::description("Enables or disables the usage of the opacity texture map"),
345
+ anno::in_group("Opacity")
346
+ ]],
347
+ uniform float opacity_constant = 1.f
348
+ [[
349
+ anno::hard_range(0.0, 1.0),
350
+ anno::display_name("Opacity Amount"),
351
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
352
+ anno::in_group("Opacity")
353
+ ]],
354
+ uniform texture_2d opacity_texture = texture_2d()
355
+ [[
356
+ anno::display_name("Opacity Map"),
357
+ anno::in_group("Opacity")
358
+ ]],
359
+ uniform base::mono_mode opacity_mode = base::mono_average
360
+ [[
361
+ anno::display_name("Opacity Mono Source"),
362
+ anno::in_group("Opacity"),
363
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum")
364
+ ]],
365
+ uniform float opacity_threshold = 0.f
366
+ [[
367
+ anno::hard_range(0.0, 1.0),
368
+ anno::display_name("Opacity Threshold"),
369
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
370
+ anno::in_group("Opacity")
371
+ ]],
372
+
373
+ // -------------------- Clearcoat ----------------------
374
+ uniform bool enable_clearcoat = false
375
+ [[
376
+ anno::display_name("Enable Clearcoat Layer"),
377
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
378
+ anno::in_group("Clearcoat")
379
+ ]],
380
+ color clearcoat_tint = color(1.0f)
381
+ [[
382
+ anno::display_name("Clearcoat Tint"),
383
+ anno::description("Clearcoat is tinted and affects the underlying material"),
384
+ anno::in_group("Clearcoat")
385
+ ]],
386
+ float clearcoat_transparency = 1.0f
387
+ [[
388
+ anno::display_name("Clearcoat Transparency"),
389
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
390
+ "covering the underlying layer"),
391
+ anno::in_group("Clearcoat"),
392
+ anno::hard_range(0.0f, 1.0f)
393
+ ]],
394
+ float clearcoat_reflection_roughness = 0.0f
395
+ [[
396
+ anno::display_name("Clearcoat Roughness"),
397
+ anno::description("Higher roughness values lead to more blurry reflections"),
398
+ anno::hard_range(0.0f, 1.0f),
399
+ anno::in_group("Clearcoat")
400
+ ]],
401
+ float clearcoat_weight = 1.0f
402
+ [[
403
+ anno::display_name("Clearcoat Weight"),
404
+ anno::description("Sets the weight for clearcoat layer"),
405
+ anno::hard_range(0.0f, 1.0f),
406
+ anno::in_group("Clearcoat")
407
+ ]],
408
+ float clearcoat_flatten = 1.0f
409
+ [[
410
+ anno::display_name("Clearcoat Flatten"),
411
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
412
+ anno::hard_range(0.0f, 1.0f),
413
+ anno::in_group("Clearcoat")
414
+ ]],
415
+ float clearcoat_ior = 1.56f
416
+ [[
417
+ anno::display_name("Clearcoat IOR"),
418
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
419
+ anno::soft_range(1.0f, 4.0f),
420
+ anno::in_group("Clearcoat")
421
+ ]],
422
+ uniform float clearcoat_bump_factor = 1.f
423
+ [[
424
+ anno::display_name("Clearcoat Normal Map Strength"),
425
+ anno::description("Strength of normal map."),
426
+ anno::in_group("Clearcoat"),
427
+ anno::soft_range(0.0f, 1.0f)
428
+ ]],
429
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
430
+ [[
431
+ anno::display_name("Clearcoat Normal Map"),
432
+ anno::description("Enables the usage of the normalmap texture"),
433
+ anno::in_group("Clearcoat")
434
+ ]],
435
+
436
+ // -------------------- Normal ----------------------
437
+
438
+
439
+
440
+ uniform float geometry_normal_roughness_strength = 1.f
441
+ [[
442
+ anno::hard_range(0.0, 1.0),
443
+ anno::display_name("Normal map to roughness weight"),
444
+ anno::description("Enables and weights roughness induced by normal maps"),
445
+ anno::in_group("Normal")
446
+ ]],
447
+ /*
448
+ uniform bool enable_normalmap_texture = false
449
+ [[
450
+ anno::display_name("Enable Normal Texture"),
451
+ anno::description("Enables the usage of the normalmap texture"),
452
+ anno::in_group("Features")
453
+ ]],
454
+ */
455
+ uniform float bump_factor = 1.f
456
+ [[
457
+ anno::display_name("Normal Map Strength"),
458
+ anno::description("Strength of normal map."),
459
+ anno::in_group("Normal"),
460
+ anno::soft_range(0.0f, 1.0f)
461
+ ]],
462
+
463
+ uniform texture_2d normalmap_texture = texture_2d()
464
+ [[
465
+ anno::display_name("Normal Map"),
466
+ anno::description("Enables the usage of the normalmap texture"),
467
+ anno::in_group("Normal")
468
+ ]],
469
+
470
+
471
+
472
+ /* uniform bool enable_detail_normalmap_texture = false
473
+ [[
474
+ anno::display_name("Enable Detail Normal Texture"),
475
+ anno::in_group("Features"),
476
+ anno::description("Enables the usage of the detail normalmap texture")
477
+ ]],
478
+ */
479
+ uniform float detail_bump_factor = .3f
480
+ [[
481
+ anno::display_name("Detail Normal Strength"),
482
+ anno::in_group("Normal"),
483
+ anno::soft_range(0.0f, 1.0f),
484
+ anno::description("Strength of the detail normal")
485
+ ]],
486
+ uniform texture_2d detail_normalmap_texture = texture_2d()
487
+ [[
488
+ anno::display_name("Detail Normal Map"),
489
+ anno::in_group("Normal")
490
+ ]],
491
+ uniform bool flip_tangent_u = false [[
492
+ anno::display_name("Normal Map Flip U Tangent"),
493
+ anno::in_group("Normal")
494
+ ]],
495
+ uniform bool flip_tangent_v = true [[
496
+ anno::display_name("Normal Map Flip V Tangent"),
497
+ anno::in_group("Normal")
498
+ ]],
499
+
500
+ // UV Projection Group
501
+ uniform bool project_uvw = false
502
+ [[
503
+ anno::display_name("Enable Project UVW Coordinates"),
504
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
505
+ anno::in_group("UV")
506
+ ]],
507
+ uniform bool world_or_object = false
508
+ [[
509
+ anno::enable_if("project_uvw == true"),
510
+ anno::display_name("Enable World Space"),
511
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
512
+ anno::in_group("UV")
513
+ ]],
514
+
515
+ uniform int uv_space_index = 0
516
+ [[
517
+ anno::enable_if("project_uvw == true"),
518
+ anno::display_name("UV Space Index"),
519
+ anno::description("UV Space Index."),
520
+ anno::in_group("UV"),
521
+ anno::hard_range(0, 3)
522
+ ]],
523
+
524
+ // Adjustments Group
525
+ uniform float2 texture_translate = float2(0.0f)
526
+ [[
527
+ anno::enable_if("project_uvw == true"),
528
+ anno::display_name("Texture Translate"),
529
+ anno::description("Controls position of texture."),
530
+ anno::in_group("UV")
531
+ ]],
532
+ uniform float texture_rotate = 0.f
533
+ [[
534
+ anno::enable_if("project_uvw == true"),
535
+ anno::display_name("Texture Rotate"),
536
+ anno::description("Rotates angle of texture in degrees."),
537
+ anno::in_group("UV")
538
+ ]],
539
+ uniform float2 texture_scale = float2(1.0f)
540
+ [[
541
+ anno::enable_if("project_uvw == true"),
542
+ anno::display_name("Texture Scale"),
543
+ anno::description("Larger number increases size of texture."),
544
+ anno::in_group("UV")
545
+ ]],
546
+
547
+ uniform float2 detail_texture_translate = float2(0.0f)
548
+ [[
549
+ anno::enable_if("project_uvw == true"),
550
+ anno::display_name("Detail Texture Translate"),
551
+ anno::description("Controls the position of the detail texture."),
552
+ anno::in_group("UV")
553
+ ]],
554
+ uniform float detail_texture_rotate = 0.f
555
+ [[
556
+ anno::enable_if("project_uvw == true"),
557
+ anno::display_name("Detail Texture Rotate"),
558
+ anno::description("Rotates angle of the detail texture in degrees."),
559
+ anno::in_group("UV")
560
+ ]],
561
+ uniform float2 detail_texture_scale = float2(1.0f)
562
+ [[
563
+ anno::enable_if("project_uvw == true"),
564
+ anno::display_name("Detail Texture Scale"),
565
+ anno::description("Larger numbers increase the size of the detail texture"),
566
+ anno::in_group("UV")
567
+ ]],
568
+
569
+ uniform float2 clearcoat_texture_translate = float2(0.0f)
570
+ [[
571
+ anno::display_name("Clearcoat Texture Translate"),
572
+ anno::description("Controls the position of the detail texture."),
573
+ anno::in_group("UV")
574
+ ]],
575
+ uniform float clearcoat_texture_rotate = 0.f
576
+ [[
577
+ anno::display_name("Clearcoat Texture Rotate"),
578
+ anno::description("Rotates angle of the detail texture in degrees."),
579
+ anno::in_group("UV")
580
+ ]],
581
+ uniform float2 clearcoat_texture_scale = float2(1.0f)
582
+ [[
583
+ anno::display_name("Clearcoat Texture Scale"),
584
+ anno::description("Larger numbers increase the size of the detail texture"),
585
+ anno::in_group("UV")
586
+ ]]
587
+
588
+ )
589
+ [[
590
+ anno::display_name("OmniPBR ClearCoat Opacity"),
591
+ anno::description("OmniPBR with ClearCoat. Supports opacity and ORM textures."),
592
+ anno::in_group("Base"),
593
+ anno::version( 2, 1, 0),
594
+ anno::author("NVIDIA CORPORATION"),
595
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
596
+ ]]
597
+ = let{
598
+
599
+ // UVW lookup and transformation
600
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
601
+
602
+
603
+ base::texture_coordinate_info uvw = project_uvw ?
604
+ base::coordinate_projection(
605
+ coordinate_system: the_system,
606
+ texture_space: uv_space_index,
607
+ projection_type: base::projection_cubic ) :
608
+ base::coordinate_source(
609
+ coordinate_system: base::texture_coordinate_uvw,
610
+ texture_space: uv_space_index
611
+ );
612
+
613
+
614
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
615
+ transform: rotation_translation_scale(
616
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
617
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
618
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
619
+ ),
620
+ coordinate: uvw
621
+ );
622
+
623
+
624
+ base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate(
625
+ transform: rotation_translation_scale(
626
+ scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0),
627
+ rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ),
628
+ translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0)
629
+ ),
630
+ coordinate: uvw
631
+ );
632
+
633
+ base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate(
634
+ transform: rotation_translation_scale(
635
+ scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0),
636
+ rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ),
637
+ translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f)
638
+ ),
639
+ coordinate: uvw
640
+ );
641
+
642
+ // Normal calculations
643
+ OmniPBRBase_1::NormalData defaultData = OmniPBRBase_1::NormalData(state::normal(), float2(0));
644
+
645
+ OmniPBRBase_1::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ?
646
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
647
+ texture: normalmap_texture,
648
+ factor: bump_factor,
649
+ uvw: transformed_uvw,
650
+ flip_tangent_u: flip_tangent_u,
651
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
652
+ //flip_tangent_v: true
653
+
654
+ ) : defaultData;
655
+ float3 the_normal = normal_data.normal;
656
+
657
+ OmniPBRBase_1::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ?
658
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
659
+ texture: detail_normalmap_texture,
660
+ factor: detail_bump_factor,
661
+ uvw: detail_transformed_uvw,
662
+ flip_tangent_u: flip_tangent_u,
663
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
664
+ ) : defaultData;
665
+ float3 detail_normal = detail_normal_data.normal;
666
+
667
+ OmniPBRBase_1::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ?
668
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
669
+ texture: clearcoat_normalmap_texture,
670
+ factor: clearcoat_bump_factor,
671
+ uvw: clearcoat_transformed_uvw,
672
+ flip_tangent_u: flip_tangent_u,
673
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
674
+ ) : defaultData;
675
+ float3 clearcoat_normal = clearcoat_normal_data.normal;
676
+
677
+ float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal;
678
+
679
+ float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten);
680
+
681
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) : flattened_clearcoat_normal;
682
+
683
+
684
+ // -------------------- ORM Handling --------------------
685
+ float3 ORM_lookup = tex::lookup_float3(
686
+ tex: ORM_texture,
687
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
688
+ );
689
+
690
+ float3 roughness_lookup = tex::lookup_float3(
691
+ tex: reflectionroughness_texture,
692
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
693
+ );
694
+
695
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x;
696
+
697
+ float reflection_roughness_1 = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
698
+
699
+
700
+ // Diffuse Color Lookup and AO
701
+
702
+ base::texture_return base_lookup = base::file_texture(
703
+ texture: diffuse_texture,
704
+ color_offset: color(albedo_add),
705
+ color_scale: color(albedo_brightness),
706
+ mono_source: base::mono_luminance,
707
+ uvw: transformed_uvw,
708
+ clip: false
709
+ );
710
+
711
+ base::texture_return ao_lookup = base::file_texture(
712
+ texture: ao_texture,
713
+ color_offset: color(0.0, 0.0, 0.0),
714
+ color_scale: color(1.0, 1.0, 1.0),
715
+ mono_source: base::mono_average,
716
+ uvw: transformed_uvw,
717
+ clip: false
718
+ );
719
+
720
+ // checking whether the ORM texture or the AO texture is supposed to be used
721
+ color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint;
722
+
723
+ color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation);
724
+
725
+ color diffuse_color = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant;
726
+
727
+ //color diffuse_color = desaturated_base ;
728
+
729
+ color tinted_diffuse_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint ;
730
+
731
+ color base_color = multiply_colors(
732
+ color_1: tinted_diffuse_color,
733
+ color_2: ao_color,
734
+ weight: ao_to_diffuse
735
+ ).tint;
736
+
737
+ float3 metallic_lookup = tex::lookup_float3(
738
+ tex: metallic_texture,
739
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
740
+ );
741
+
742
+ // Choose between ORM or metallic map
743
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x;
744
+
745
+ // blend between the constant metallic value and the map lookup
746
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
747
+
748
+
749
+ bsdf diffuse_bsdf = df::weighted_layer(
750
+ weight: 1.0,
751
+ layer: df::diffuse_reflection_bsdf(
752
+ tint: base_color,
753
+ roughness: 0.f ),
754
+ base: bsdf(),
755
+ normal: enable_clearcoat ? diffuse_gloss_normal : state::normal()
756
+ );
757
+
758
+ // The glossy reflection BSDF
759
+ // TODO: Clearcoat's induced roughness from normal map should also apply here, but right now avoiding it due to confusing relationship in the normals
760
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
761
+ roughness_u:reflection_roughness_1 * reflection_roughness_1 + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x),
762
+ roughness_v:reflection_roughness_1 * reflection_roughness_1 + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y),
763
+ tint: color(1.0, 1.0, 1.0),
764
+ mode: df::scatter_reflect
765
+ );
766
+
767
+
768
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
769
+ normal_reflectivity: 0.08,
770
+ grazing_reflectivity: 1.0,
771
+ exponent: 5.0,
772
+ weight: specular_level,
773
+ layer: ggx_smith_bsdf,
774
+ base: diffuse_bsdf,
775
+ normal: enable_clearcoat ? diffuse_gloss_normal : state::normal()
776
+ );
777
+
778
+ // Replaced by tinting as this reproduces the UE4 behavior more faithfully
779
+ // bsdf directional_factor_bsdf = df::directional_factor(
780
+ // normal_tint: base_color,
781
+ // grazing_tint: base_color, //color(1.0, 1.0, 1.0),
782
+ // exponent: 3.0f,
783
+ // base: ggx_smith_bsdf
784
+ // );
785
+
786
+ bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
787
+
788
+
789
+ // CLEARCOAT
790
+
791
+
792
+ bsdf omni_PBR_bsdf = df::weighted_layer(
793
+ weight: metallic,
794
+ layer: directional_factor_bsdf,
795
+ base: custom_curve_layer_bsdf,
796
+ normal: enable_clearcoat ? diffuse_gloss_normal : state::normal()
797
+ );
798
+
799
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
800
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x),
801
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y),
802
+ tint: color(1.0f),
803
+ mode: df::scatter_reflect
804
+ );
805
+
806
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
807
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
808
+ // grazing_reflectivity: 1.0,
809
+ // weight: clearcoat_weight,
810
+ // layer: clearcoat_bsdf,
811
+ // base: omni_PBR_bsdf,
812
+ // normal: final_clearcoat_normal
813
+ // );
814
+
815
+ bsdf opaque_clearcoat = df::weighted_layer(
816
+ weight: clearcoat_transparency,
817
+ layer: ::df::tint(
818
+ tint: clearcoat_tint,
819
+ base: omni_PBR_bsdf),
820
+ base: ::df::diffuse_reflection_bsdf(
821
+ tint: clearcoat_tint)
822
+ );
823
+
824
+ bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
825
+ ior: clearcoat_ior,
826
+ weight: clearcoat_weight,
827
+ layer: clearcoat_bsdf,
828
+ base: opaque_clearcoat,
829
+ normal: final_clearcoat_normal
830
+ );
831
+
832
+
833
+ bsdf final_bsdf = enable_clearcoat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
834
+
835
+ // Emission
836
+ color emissive_color_tx = tex::texture_isvalid(emissive_color_texture) ?
837
+ base::file_texture(
838
+ texture: emissive_color_texture,
839
+ color_offset: color(0.0, 0.0, 0.0),
840
+ color_scale: color(1.0, 1.0, 1.0),
841
+ mono_source: base::mono_average,
842
+ uvw: transformed_uvw,
843
+ clip: false
844
+ ).tint : emissive_color;
845
+
846
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
847
+ base::file_texture(
848
+ texture: emissive_mask_texture,
849
+ color_offset: color(0.0, 0.0, 0.0),
850
+ color_scale: color(1.0, 1.0, 1.0),
851
+ mono_source: base::mono_average,
852
+ uvw: transformed_uvw,
853
+ clip: false
854
+ ).tint : color(1.0);
855
+
856
+ float opacity_value = enable_opacity_texture ? base::file_texture(
857
+ texture: opacity_texture,
858
+ mono_source: opacity_mode,
859
+ uvw: transformed_uvw
860
+ ).mono : opacity_constant;
861
+
862
+ // The opacity_threshold is interpreted as follows:
863
+ // 1. opacity_threshold > 0: binary opacity masking mode
864
+ // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0
865
+ // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched,
866
+ // allowing the renderer to use fractional cutout_opacity values, if it supports this feature
867
+ //
868
+ // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets
869
+ // cutout_opacity values of 1.0 as opaque and anything below as fully transparent
870
+ float local_cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
871
+
872
+ } in material(
873
+ surface: material_surface(
874
+ scattering: final_bsdf,
875
+ emission: material_emission (
876
+ df::diffuse_edf(),
877
+ intensity: enable_emission? emissive_color_tx * emissive_mask * color(emissive_intensity) : color(0)
878
+ )
879
+ ),
880
+ geometry: material_geometry(
881
+ normal: enable_clearcoat ? state::normal() : diffuse_gloss_normal,
882
+ cutout_opacity: local_cutout_opacity
883
+ )
884
+ );
saved/assets/_dependencies/public_validation/materials/OmniPBR_Opacity.mdl ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+ mdl 1.4;
29
+
30
+ import ::base::*;
31
+ import ::anno::*;
32
+
33
+ using OmniPBR_ClearCoat_Opacity import OmniPBR_ClearCoat_Opacity;
34
+
35
+
36
+
37
+ export material OmniPBR_Opacity(
38
+
39
+ color diffuse_color_constant = color(0.2f)
40
+ [[
41
+ anno::display_name("Base Color"),
42
+ anno::description("This is the base color"),
43
+ anno::in_group("Albedo")
44
+ ]],
45
+ uniform texture_2d diffuse_texture = texture_2d()
46
+ [[
47
+ anno::display_name("Albedo Map"),
48
+ anno::in_group("Albedo")
49
+ ]],
50
+ float albedo_desaturation = float(0.0)
51
+ [[
52
+ anno::display_name("Albedo Desaturation"),
53
+ anno::soft_range(float(0.0f), float(1.0f)),
54
+ anno::description("Desaturates the diffuse color"),
55
+ anno::in_group("Albedo")
56
+ ]],
57
+ float albedo_add = float(0.0)
58
+ [[
59
+ anno::display_name("Albedo Add"),
60
+ anno::soft_range(float(-1.0f), float(1.0f)),
61
+ anno::description("Adds a constant value to the diffuse color "),
62
+ anno::in_group("Albedo")
63
+ ]],
64
+ float albedo_brightness = float(1.0)
65
+ [[
66
+ anno::display_name("Albedo Brightness"),
67
+ anno::soft_range(float(0.0f), float(1.0f)),
68
+ anno::description("Multiplier for the diffuse color "),
69
+ anno::in_group("Albedo")
70
+ ]],
71
+ color diffuse_tint = color(1.0f)
72
+ [[
73
+ anno::display_name("Color Tint"),
74
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
75
+ anno::in_group("Albedo")
76
+ ]],
77
+
78
+
79
+ // -------------------- REFLECTIVITY ----------------------
80
+
81
+
82
+
83
+ float reflection_roughness_constant = 0.5f
84
+ [[
85
+ anno::display_name("Roughness Amount"),
86
+ anno::hard_range(0.0,1.),
87
+ anno::description("Higher roughness values lead to more blurry reflections"),
88
+ anno::in_group("Reflectivity")
89
+ ]],
90
+ float reflection_roughness_texture_influence = 0.0f
91
+ [[
92
+ anno::display_name("Roughness Map Influence"),
93
+ anno::hard_range(0.0, 1.),
94
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
95
+ anno::in_group("Reflectivity")
96
+ ]],
97
+ uniform texture_2d reflectionroughness_texture = texture_2d()
98
+ [[
99
+ anno::display_name("Roughness Map"),
100
+ anno::in_group("Reflectivity")
101
+ ]],
102
+
103
+
104
+ float metallic_constant = 0.f
105
+ [[
106
+ anno::display_name("Metallic Amount"),
107
+ anno::hard_range(0.0,1.),
108
+ anno::description("Metallic Material"),
109
+ anno::in_group("Reflectivity")
110
+ ]],
111
+ float metallic_texture_influence = 0.0f
112
+ [[
113
+ anno::display_name("Metallic Map Influence"),
114
+ anno::hard_range(0.0, 1.),
115
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
116
+ anno::in_group("Reflectivity")
117
+ ]],
118
+ uniform texture_2d metallic_texture = texture_2d()
119
+ [[
120
+ anno::display_name("Metallic Map"),
121
+ anno::in_group("Reflectivity")
122
+ ]],
123
+ float specular_level = float(0.5)
124
+ [[
125
+ anno::display_name("Specular"),
126
+ anno::soft_range(float(0.0f), float(1.0f)),
127
+ anno::description("The specular level (intensity) of the material"),
128
+ anno::in_group("Reflectivity")
129
+ ]],
130
+ // -------------------- ORM ----------------------
131
+ uniform bool enable_ORM_texture = false
132
+ [[
133
+ anno::display_name("Enable ORM Texture"),
134
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
135
+ anno::in_group("Reflectivity")
136
+ ]],
137
+ uniform texture_2d ORM_texture = texture_2d()
138
+ [[
139
+ anno::display_name("ORM Map"),
140
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
141
+ anno::in_group("Reflectivity")
142
+ ]],
143
+
144
+ // -------------------- AO Group ----------------------
145
+
146
+ float ao_to_diffuse = 0.0
147
+ [[
148
+ anno::display_name("AO to Diffuse"),
149
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
150
+ anno::in_group("AO"),
151
+ anno::hard_range(0.0f, 1.0f)
152
+ ]],
153
+ uniform texture_2d ao_texture = texture_2d()
154
+ [[
155
+ anno::display_name("Ambient Occlusion Map"),
156
+ anno::description("The Ambient Occlusion texture for the material"),
157
+ anno::in_group("AO")
158
+ ]],
159
+
160
+
161
+ // -------------------- EMISSIVE ----------------------
162
+
163
+
164
+ uniform bool enable_emission = false
165
+ [[
166
+ anno::display_name("Enable Emission"),
167
+ anno::description("Enables the emission of light from the material"),
168
+ anno::in_group("Emissive")
169
+ ]],
170
+
171
+ color emissive_color = color(1.0, 0.1, 0.1)
172
+ [[
173
+ anno::enable_if("enable_emission == true"),
174
+ anno::display_name("Emissive Color"),
175
+ anno::description("The emission color"),
176
+ anno::in_group("Emissive")
177
+
178
+ ]],
179
+ uniform texture_2d emissive_color_texture = texture_2d()
180
+ [[
181
+ anno::enable_if("enable_emission == true"),
182
+ anno::display_name("Emissive Color map"),
183
+ anno::in_group("Emissive"),
184
+ anno::description("The emissive color texture")
185
+ ]],
186
+ uniform texture_2d emissive_mask_texture = texture_2d()
187
+ [[
188
+ anno::enable_if("enable_emission == true"),
189
+ anno::display_name("Emissive Mask map"),
190
+ anno::description("The texture masking the emissive color"),
191
+ anno::in_group("Emissive")
192
+ ]],
193
+ uniform float emissive_intensity = 40.f
194
+ [[
195
+ anno::enable_if("enable_emission == true"),
196
+ anno::display_name("Emissive Intensity"),
197
+ anno::description("Intensity of the emission"),
198
+ anno::in_group("Emissive")
199
+ ]],
200
+
201
+ // Cutout Opacity
202
+ uniform bool enable_opacity = true
203
+ [[
204
+ anno::display_name("Enable Opacity"),
205
+ anno::description("Enables the use of cutout opacity"),
206
+ anno::in_group("Opacity")
207
+ ]],
208
+ uniform bool enable_opacity_texture = false
209
+ [[
210
+ anno::display_name("Enable Opacity Texture"),
211
+ anno::description("Enables or disables the usage of the opacity texture map"),
212
+ anno::in_group("Opacity")
213
+ ]],
214
+ uniform float opacity_constant = 1.f
215
+ [[
216
+ anno::hard_range(0.0, 1.0),
217
+ anno::display_name("Opacity Amount"),
218
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
219
+ anno::in_group("Opacity")
220
+ ]],
221
+ uniform texture_2d opacity_texture = texture_2d()
222
+ [[
223
+ anno::display_name("Opacity Map"),
224
+ anno::in_group("Opacity")
225
+ ]],
226
+ uniform base::mono_mode opacity_mode = base::mono_average
227
+ [[
228
+ anno::display_name("Opacity Mono Source"),
229
+ anno::in_group("Opacity"),
230
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum")
231
+ ]],
232
+ uniform float opacity_threshold = 0.f
233
+ [[
234
+ anno::hard_range(0.0, 1.0),
235
+ anno::display_name("Opacity Threshold"),
236
+ 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"),
237
+ anno::in_group("Opacity")
238
+ ]],
239
+
240
+ // -------------------- Normal ----------------------
241
+
242
+
243
+
244
+ /*
245
+ uniform bool enable_normalmap_texture = false
246
+ [[
247
+ anno::display_name("Enable Normal Texture"),
248
+ anno::description("Enables the usage of the normalmap texture"),
249
+ anno::in_group("Features")
250
+ ]],
251
+ */
252
+ uniform float bump_factor = 1.f
253
+ [[
254
+ anno::display_name("Normal Map Strength"),
255
+ anno::description("Strength of normal map."),
256
+ anno::in_group("Normal"),
257
+ anno::soft_range(0.0f, 1.0f)
258
+ ]],
259
+
260
+ uniform texture_2d normalmap_texture = texture_2d()
261
+ [[
262
+ anno::display_name("Normal Map"),
263
+ anno::description("Enables the usage of the normalmap texture"),
264
+ anno::in_group("Normal")
265
+ ]],
266
+
267
+
268
+
269
+ /* uniform bool enable_detail_normalmap_texture = false
270
+ [[
271
+ anno::display_name("Enable Detail Normal Texture"),
272
+ anno::in_group("Features"),
273
+ anno::description("Enables the usage of the detail normalmap texture")
274
+ ]],
275
+ */
276
+ uniform float detail_bump_factor = .3f
277
+ [[
278
+ anno::display_name("Detail Normal Strength"),
279
+ anno::in_group("Normal"),
280
+ anno::soft_range(0.0f, 1.0f),
281
+ anno::description("Strength of the detail normal")
282
+ ]],
283
+ uniform texture_2d detail_normalmap_texture = texture_2d()
284
+ [[
285
+ anno::display_name("Detail Normal Map"),
286
+ anno::in_group("Normal")
287
+ ]],
288
+ // UV Projection Group
289
+ uniform bool project_uvw = false
290
+ [[
291
+ anno::display_name("Enable Project UVW Coordinates"),
292
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
293
+ anno::in_group("UV")
294
+ ]],
295
+ uniform bool world_or_object = false
296
+ [[
297
+ anno::enable_if("project_uvw == true"),
298
+ anno::display_name("Enable World Space"),
299
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
300
+ anno::in_group("UV")
301
+ ]],
302
+
303
+ uniform int uv_space_index = 0
304
+ [[
305
+ anno::enable_if("project_uvw == true"),
306
+ anno::display_name("UV Space Index"),
307
+ anno::description("UV Space Index."),
308
+ anno::in_group("UV"),
309
+ anno::hard_range(0, 3)
310
+ ]],
311
+
312
+ // Adjustments Group
313
+ uniform float2 texture_translate = float2(0.0f)
314
+ [[
315
+ anno::enable_if("project_uvw == true"),
316
+ anno::display_name("Texture Translate"),
317
+ anno::description("Controls position of texture."),
318
+ anno::in_group("UV")
319
+ ]],
320
+ uniform float texture_rotate = 0.f
321
+ [[
322
+ anno::enable_if("project_uvw == true"),
323
+ anno::display_name("Texture Rotate"),
324
+ anno::description("Rotates angle of texture in degrees."),
325
+ anno::in_group("UV")
326
+ ]],
327
+ uniform float2 texture_scale = float2(1.0f)
328
+ [[
329
+ anno::enable_if("project_uvw == true"),
330
+ anno::display_name("Texture Scale"),
331
+ anno::description("Larger number increases size of texture."),
332
+ anno::in_group("UV")
333
+ ]],
334
+
335
+ uniform float2 detail_texture_translate = float2(0.0f)
336
+ [[
337
+ anno::enable_if("project_uvw == true"),
338
+ anno::display_name("Detail Texture Translate"),
339
+ anno::description("Controls the position of the detail texture."),
340
+ anno::in_group("UV")
341
+ ]],
342
+ uniform float detail_texture_rotate = 0.f
343
+ [[
344
+ anno::enable_if("project_uvw == true"),
345
+ anno::display_name("Detail Texture Rotate"),
346
+ anno::description("Rotates angle of the detail texture in degrees."),
347
+ anno::in_group("UV")
348
+ ]],
349
+ uniform float2 detail_texture_scale = float2(1.0f)
350
+ [[
351
+ anno::enable_if("project_uvw == true"),
352
+ anno::display_name("Detail Texture Scale"),
353
+ anno::description("Larger numbers increase the size of the detail texture"),
354
+ anno::in_group("UV")
355
+ ]]
356
+ )
357
+ [[
358
+ anno::display_name("OmniPBR Opacity"),
359
+ anno::description("OmniPBR supports opacity and ORM textures"),
360
+ anno::in_group("Base"),
361
+ anno::version( 2, 1, 0),
362
+ anno::author("NVIDIA CORPORATION"),
363
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
364
+ ]]
365
+ = OmniPBR_ClearCoat_Opacity(
366
+ diffuse_texture: diffuse_texture,
367
+ albedo_desaturation: albedo_desaturation,
368
+ albedo_add: albedo_add,
369
+ albedo_brightness: albedo_brightness,
370
+ diffuse_color_constant: diffuse_color_constant,
371
+ diffuse_tint: diffuse_tint,
372
+ //ao
373
+ ao_texture: ao_texture,
374
+ ao_to_diffuse: ao_to_diffuse,
375
+ //ORM
376
+ ORM_texture: ORM_texture,
377
+ enable_ORM_texture: enable_ORM_texture,
378
+ //reflectivity
379
+ reflection_roughness_constant: reflection_roughness_constant,
380
+ reflectionroughness_texture: reflectionroughness_texture,
381
+ reflection_roughness_texture_influence: reflection_roughness_texture_influence,
382
+ metallic_constant: metallic_constant,
383
+ metallic_texture: metallic_texture,
384
+ metallic_texture_influence: metallic_texture_influence,
385
+ specular_level: specular_level,
386
+ //opacity
387
+ enable_opacity: enable_opacity,
388
+ enable_opacity_texture: enable_opacity_texture,
389
+ opacity_texture: opacity_texture,
390
+ opacity_constant: opacity_constant,
391
+ opacity_mode: opacity_mode,
392
+ opacity_threshold: opacity_threshold,
393
+ //emissive
394
+ enable_emission: enable_emission,
395
+ emissive_color: emissive_color,
396
+ emissive_color_texture: emissive_color_texture,
397
+ emissive_mask_texture: emissive_mask_texture,
398
+ emissive_intensity: emissive_intensity,
399
+ //clearcoat
400
+ enable_clearcoat: false,
401
+ clearcoat_tint: color(1.0f),
402
+ clearcoat_transparency: 1.0f,
403
+ clearcoat_reflection_roughness: 0.0f,
404
+ clearcoat_weight: 1.0f,
405
+ clearcoat_flatten: 1.0f,
406
+ clearcoat_ior: 1.56f,
407
+ clearcoat_bump_factor: 1.f,
408
+ clearcoat_normalmap_texture: texture_2d(),
409
+ //normal
410
+ normalmap_texture: normalmap_texture,
411
+ bump_factor: bump_factor,
412
+ detail_normalmap_texture: detail_normalmap_texture,
413
+ detail_bump_factor: detail_bump_factor,
414
+ project_uvw: project_uvw,
415
+ world_or_object: world_or_object,
416
+ uv_space_index: uv_space_index,
417
+ texture_translate: texture_translate,
418
+ texture_rotate: texture_rotate,
419
+ texture_scale: texture_scale,
420
+ detail_texture_translate: detail_texture_translate,
421
+ detail_texture_rotate: detail_texture_rotate,
422
+ detail_texture_scale: detail_texture_scale,
423
+ clearcoat_texture_translate: float2(0.0f),
424
+ clearcoat_texture_rotate: 0.0f,
425
+ clearcoat_texture_scale: float2(1.0f)
426
+ );
saved/assets/_dependencies/public_validation/materials/OmniSurface.mdl ADDED
@@ -0,0 +1,1688 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ // Wrapper for OmniSurfaceBase material
30
+
31
+ mdl 1.7;
32
+
33
+ import ::anno::*;
34
+ import ::base::*;
35
+ import ::limits::*;
36
+ import ::state::*;
37
+ import ::tex::*;
38
+
39
+ import ::OmniSurface::OmniSurfaceBase::*;
40
+ import ::OmniSurface::OmniShared::*;
41
+ import ::OmniSurface::OmniImage::*;
42
+
43
+ export material OmniSurface(
44
+
45
+ //Diffuse reflection
46
+ //
47
+ float diffuse_reflection_weight = float(0.8) [[
48
+ anno::display_name("Weight"),
49
+ anno::in_group("Base"),
50
+ anno::hard_range(0.0f, 1.0f)
51
+ ]],
52
+
53
+ uniform texture_2d diffuse_reflection_weight_image = texture_2d() [[
54
+ anno::display_name("Weight Image"),
55
+ anno::in_group("Base"),
56
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
57
+ ]],
58
+
59
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_weight_image_alpha_mode =
60
+ ::OmniSurface::OmniImage::alpha_default [[
61
+ anno::display_name("Weight Image Alpha Mode"),
62
+ anno::in_group("Base")
63
+ ]],
64
+
65
+ color diffuse_reflection_color = color(1.0) [[
66
+ anno::display_name("Color"),
67
+ anno::in_group("Base")
68
+ ]],
69
+
70
+ uniform texture_2d diffuse_reflection_color_image = texture_2d() [[
71
+ anno::display_name("Color Image"),
72
+ anno::in_group("Base")
73
+ ]],
74
+
75
+ float diffuse_reflection_roughness = float(0.0) [[
76
+ anno::display_name("Diffuse Roughness"),
77
+ anno::in_group("Base"),
78
+ anno::hard_range(0.0f, 1.0f)
79
+ ]],
80
+
81
+ uniform texture_2d diffuse_reflection_roughness_image = texture_2d() [[
82
+ anno::display_name("Diffuse Roughness Image"),
83
+ anno::in_group("Base"),
84
+ anno::usage("roughness")
85
+ ]],
86
+
87
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_roughness_image_alpha_mode =
88
+ ::OmniSurface::OmniImage::alpha_default [[
89
+ anno::display_name("Diffuse Roughness Alpha Mode"),
90
+ anno::in_group("Base")
91
+ ]],
92
+
93
+ //Metal
94
+ //
95
+ float metalness = float(0.0) [[
96
+ anno::display_name("Metalness"),
97
+ anno::in_group("Base"),
98
+ anno::hard_range(0.0f, 1.0f)
99
+ ]],
100
+
101
+ uniform texture_2d metalness_image = texture_2d() [[
102
+ anno::display_name("Metalness Image"),
103
+ anno::in_group("Base"),
104
+ anno::usage("metalness")
105
+ ]],
106
+
107
+ uniform ::OmniSurface::OmniImage::alpha_mode metalness_image_alpha_mode =
108
+ ::OmniSurface::OmniImage::alpha_default [[
109
+ anno::display_name("Metalness Image Alpha Mode"),
110
+ anno::in_group("Base")
111
+ ]],
112
+
113
+ //Specular reflection
114
+ //
115
+ float specular_reflection_weight = float(1.0) [[
116
+ anno::display_name("Weight"),
117
+ anno::in_group("Specular"),
118
+ anno::hard_range(0.0f, 1.0f)
119
+ ]],
120
+
121
+ uniform texture_2d specular_reflection_weight_image = texture_2d() [[
122
+ anno::display_name("Weight Image"),
123
+ anno::in_group("Specular"),
124
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
125
+ ]],
126
+
127
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_weight_image_alpha_mode =
128
+ ::OmniSurface::OmniImage::alpha_default [[
129
+ anno::display_name("Weight Image Alpha Mode"),
130
+ anno::in_group("Specular")
131
+ ]],
132
+
133
+ color specular_reflection_color = color(1.0) [[
134
+ anno::display_name("Color"),
135
+ anno::in_group("Specular")
136
+ ]],
137
+
138
+ uniform texture_2d specular_reflection_color_image = texture_2d() [[
139
+ anno::display_name("Color Image"),
140
+ anno::in_group("Specular")
141
+ ]],
142
+
143
+ float specular_reflection_roughness = float(0.2) [[
144
+ anno::display_name("Roughness"),
145
+ anno::in_group("Specular"),
146
+ anno::hard_range(0.0f, 1.0f)
147
+ ]],
148
+
149
+ uniform texture_2d specular_reflection_roughness_image = texture_2d() [[
150
+ anno::display_name("Roughness Image"),
151
+ anno::in_group("Specular"),
152
+ anno::usage("roughness")
153
+ ]],
154
+
155
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_roughness_image_alpha_mode =
156
+ ::OmniSurface::OmniImage::alpha_default [[
157
+ anno::display_name("Roughness Image Alpha Mode"),
158
+ anno::in_group("Specular")
159
+ ]],
160
+
161
+ uniform ::OmniSurface::OmniShared::ior_presets specular_reflection_ior_preset =
162
+ ::OmniSurface::OmniShared::ior_custom [[
163
+ anno::display_name("IOR Preset"),
164
+ anno::in_group("Specular")
165
+ ]],
166
+
167
+ uniform float specular_reflection_ior = float(1.5) [[
168
+ anno::display_name("IOR"),
169
+ anno::in_group("Specular"),
170
+ anno::soft_range(1.0f, 5.0f),
171
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
172
+ ]],
173
+
174
+ float specular_reflection_anisotropy = float(0.0) [[
175
+ anno::display_name("Anisotropy"),
176
+ anno::in_group("Specular"),
177
+ anno::hard_range(0.0f, 1.0f)
178
+ ]],
179
+
180
+ uniform texture_2d specular_reflection_anisotropy_image = texture_2d() [[
181
+ anno::display_name("Anisotropy Image"),
182
+ anno::in_group("Specular"),
183
+ anno::usage("anisotropy")
184
+ ]],
185
+
186
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_image_alpha_mode =
187
+ ::OmniSurface::OmniImage::alpha_default [[
188
+ anno::display_name("Anisotropy Image Alpha Mode"),
189
+ anno::in_group("Specular")
190
+ ]],
191
+
192
+ float specular_reflection_anisotropy_rotation = float(0.0) [[
193
+ anno::display_name("Rotation (radian)"),
194
+ anno::in_group("Specular"),
195
+ anno::soft_range(0.0f, 1.0f)
196
+ ]],
197
+
198
+ uniform texture_2d specular_reflection_anisotropy_rotation_image = texture_2d() [[
199
+ anno::display_name("Anisotropy Rotation Image"),
200
+ anno::in_group("Specular"),
201
+ anno::usage("anisotropy_rotation")
202
+ ]],
203
+
204
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_rotation_image_alpha_mode =
205
+ ::OmniSurface::OmniImage::alpha_default [[
206
+ anno::display_name("Anisotropy Rotation Alpha Mode"),
207
+ anno::in_group("Specular")
208
+ ]],
209
+
210
+ //Specular transmission
211
+ //
212
+ uniform bool enable_specular_transmission = false [[
213
+ anno::display_name("Enable Transmission"),
214
+ anno::description("Enables the use of transmission"),
215
+ anno::in_group("Transmission")
216
+ ]],
217
+
218
+ float specular_transmission_weight = float(0.0) [[
219
+ anno::display_name("Weight"),
220
+ anno::in_group("Transmission"),
221
+ anno::hard_range(0.0f, 1.0f)
222
+ ]],
223
+
224
+ uniform texture_2d specular_transmission_weight_image = texture_2d() [[
225
+ anno::display_name("Weight Image"),
226
+ anno::in_group("Transmission"),
227
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
228
+ ]],
229
+
230
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_transmission_weight_image_alpha_mode =
231
+ ::OmniSurface::OmniImage::alpha_default [[
232
+ anno::display_name("Weight Image Alpha Mode"),
233
+ anno::in_group("Transmission")
234
+ ]],
235
+
236
+ color specular_transmission_color = color(1.0) [[
237
+ anno::display_name("Color"),
238
+ anno::in_group("Transmission")
239
+ ]],
240
+
241
+ uniform texture_2d specular_transmission_color_image = texture_2d() [[
242
+ anno::display_name("Color Image"),
243
+ anno::in_group("Transmission")
244
+ ]],
245
+
246
+ float specular_transmission_scattering_depth = float(0.0) [[
247
+ anno::display_name("Depth"),
248
+ anno::in_group("Transmission"),
249
+ anno::soft_range(0.0f, 100.0f),
250
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
251
+ ]],
252
+
253
+ uniform texture_2d specular_transmission_scattering_depth_image = texture_2d() [[
254
+ anno::display_name("Depth Image"),
255
+ anno::in_group("Transmission"),
256
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
257
+ ]],
258
+
259
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_transmission_scattering_depth_image_alpha_mode =
260
+ ::OmniSurface::OmniImage::alpha_default [[
261
+ anno::display_name("Depth Image Alpha Mode"),
262
+ anno::in_group("Transmission")
263
+ ]],
264
+
265
+ color specular_transmission_scattering_color = color(0.0) [[
266
+ anno::display_name("Scatter"),
267
+ anno::in_group("Transmission")
268
+ ]],
269
+
270
+ uniform texture_2d specular_transmission_scattering_color_image = texture_2d() [[
271
+ anno::display_name("Scatter Image"),
272
+ anno::in_group("Transmission")
273
+ ]],
274
+
275
+ float specular_transmission_scatter_anisotropy = float(0.0) [[
276
+ anno::display_name("Scatter Anisotropy"),
277
+ anno::in_group("Transmission"),
278
+ anno::hard_range(-1.0f, 1.0f)
279
+ ]],
280
+
281
+ uniform texture_2d specular_transmission_scatter_anisotropy_image = texture_2d() [[
282
+ anno::display_name("Scatter Anisotropy Image"),
283
+ anno::in_group("Transmission")
284
+ ]],
285
+
286
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_transmission_scatter_anisotropy_image_alpha_mode =
287
+ ::OmniSurface::OmniImage::alpha_default [[
288
+ anno::display_name("Scatter Anisotropy Image Alpha Mode"),
289
+ anno::in_group("Transmission")
290
+ ]],
291
+
292
+ uniform float specular_transmission_dispersion_abbe = float(0.0) [[
293
+ anno::display_name("Dispersion Abbe"),
294
+ anno::in_group("Transmission"),
295
+ anno::soft_range(0.0f, 100.0f),
296
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
297
+ ]],
298
+
299
+ //Subsurface
300
+ //
301
+ uniform bool enable_diffuse_transmission = false [[
302
+ anno::display_name("Enable Subsurface"),
303
+ anno::description("Enables the use of subsurface"),
304
+ anno::in_group("Subsurface")
305
+ ]],
306
+
307
+ float subsurface_weight = float(0.0) [[
308
+ anno::display_name("Weight"),
309
+ anno::in_group("Subsurface"),
310
+ anno::hard_range(0.0f, 1.0f)
311
+ ]],
312
+
313
+ uniform texture_2d subsurface_weight_image = texture_2d() [[
314
+ anno::display_name("Weight Image"),
315
+ anno::in_group("Subsurface"),
316
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
317
+ ]],
318
+
319
+ uniform ::OmniSurface::OmniImage::alpha_mode subsurface_weight_image_alpha_mode =
320
+ ::OmniSurface::OmniImage::alpha_default [[
321
+ anno::display_name("Weight Image Alpha Mode"),
322
+ anno::in_group("Subsurface")
323
+ ]],
324
+
325
+ uniform ::OmniSurface::OmniShared::scattering_colors_presets subsurface_scattering_colors_preset =
326
+ ::OmniSurface::OmniShared::scattering_colors_custom [[
327
+ anno::display_name("Scattering Presets"),
328
+ anno::in_group("Subsurface")
329
+ ]],
330
+
331
+ color subsurface_transmission_color = color(1.0) [[
332
+ anno::display_name("Color"),
333
+ anno::in_group("Subsurface")
334
+ ]],
335
+
336
+ uniform texture_2d subsurface_transmission_color_image = texture_2d() [[
337
+ anno::display_name("Color Image"),
338
+ anno::in_group("Subsurface")
339
+ ]],
340
+
341
+ color subsurface_scattering_color = color(1.0) [[
342
+ anno::display_name("Radius (mfp)"),
343
+ anno::in_group("Subsurface")
344
+ ]],
345
+
346
+ uniform texture_2d subsurface_scattering_color_image = texture_2d() [[
347
+ anno::display_name("Radius Image"),
348
+ anno::in_group("Subsurface")
349
+ ]],
350
+
351
+ float subsurface_scale = float(1.0) [[
352
+ anno::display_name("Scale"),
353
+ anno::in_group("Subsurface"),
354
+ anno::soft_range(0.0f, 10.0f),
355
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
356
+ ]],
357
+
358
+ uniform texture_2d subsurface_scale_image = texture_2d() [[
359
+ anno::display_name("Scale Image"),
360
+ anno::in_group("Subsurface"),
361
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
362
+ ]],
363
+
364
+ uniform ::OmniSurface::OmniImage::alpha_mode subsurface_scale_image_alpha_mode =
365
+ ::OmniSurface::OmniImage::alpha_default [[
366
+ anno::display_name("Scale Image Alpha Mode"),
367
+ anno::in_group("Subsurface")
368
+ ]],
369
+
370
+ float subsurface_anisotropy = float(0.0) [[
371
+ anno::display_name("Anisotropy"),
372
+ anno::in_group("Subsurface"),
373
+ anno::hard_range(-1.0f, 1.0f)
374
+ ]],
375
+
376
+ uniform texture_2d subsurface_anisotropy_image = texture_2d() [[
377
+ anno::display_name("Anisotropy Image"),
378
+ anno::in_group("Subsurface"),
379
+ anno::usage("anisotropy")
380
+ ]],
381
+
382
+ uniform ::OmniSurface::OmniImage::alpha_mode subsurface_anisotropy_image_alpha_mode =
383
+ ::OmniSurface::OmniImage::alpha_default [[
384
+ anno::display_name("Anisotropy Image Alpha Mode"),
385
+ anno::in_group("Subsurface")
386
+ ]],
387
+
388
+ //Coat
389
+ //
390
+ float coat_weight = float(0.0) [[
391
+ anno::display_name("Weight"),
392
+ anno::in_group("Coat"),
393
+ anno::hard_range(0.0f, 1.0f)
394
+ ]],
395
+
396
+ uniform texture_2d coat_weight_image = texture_2d() [[
397
+ anno::display_name("Weight Image"),
398
+ anno::in_group("Coat"),
399
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
400
+ ]],
401
+
402
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_weight_image_alpha_mode =
403
+ ::OmniSurface::OmniImage::alpha_default [[
404
+ anno::display_name("Weight Image Alpha Mode"),
405
+ anno::in_group("Coat")
406
+ ]],
407
+
408
+ color coat_color = color(1.0) [[
409
+ anno::display_name("Color"),
410
+ anno::in_group("Coat")
411
+ ]],
412
+
413
+ uniform texture_2d coat_color_image = texture_2d() [[
414
+ anno::display_name("Color Image"),
415
+ anno::in_group("Coat")
416
+ ]],
417
+
418
+ float coat_roughness = float(0.1) [[
419
+ anno::display_name("Roughness"),
420
+ anno::in_group("Coat"),
421
+ anno::hard_range(0.0f, 1.0f)
422
+ ]],
423
+
424
+ uniform texture_2d coat_roughness_image = texture_2d() [[
425
+ anno::display_name("Roughness Image"),
426
+ anno::in_group("Coat"),
427
+ anno::usage("roughness")
428
+ ]],
429
+
430
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_roughness_image_alpha_mode =
431
+ ::OmniSurface::OmniImage::alpha_default [[
432
+ anno::display_name("Roughness Image Alpha Mode"),
433
+ anno::in_group("Coat")
434
+ ]],
435
+
436
+ uniform ::OmniSurface::OmniShared::ior_presets coat_ior_preset =
437
+ ::OmniSurface::OmniShared::ior_custom [[
438
+ anno::display_name("IOR Preset"),
439
+ anno::in_group("Coat")
440
+ ]],
441
+
442
+ uniform float coat_ior = float(1.5) [[
443
+ anno::display_name("IOR"),
444
+ anno::in_group("Coat"),
445
+ anno::soft_range(1.0f, 5.0f),
446
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
447
+ ]],
448
+
449
+ float coat_anisotropy = float(0.0) [[
450
+ anno::display_name("Anisotropy"),
451
+ anno::in_group("Coat"),
452
+ anno::hard_range(0.0f, 1.0f)
453
+ ]],
454
+
455
+ uniform texture_2d coat_anisotropy_image = texture_2d() [[
456
+ anno::display_name("Anisotropy Image"),
457
+ anno::in_group("Coat"),
458
+ anno::usage("anisotropy")
459
+ ]],
460
+
461
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_image_alpha_mode =
462
+ ::OmniSurface::OmniImage::alpha_default [[
463
+ anno::display_name("Anisotropy Image Alpha Mode"),
464
+ anno::in_group("Coat")
465
+ ]],
466
+
467
+ float coat_anisotropy_rotation = float(0.0) [[
468
+ anno::display_name("Rotation (radian)"),
469
+ anno::in_group("Coat"),
470
+ anno::soft_range(0.0f, 1.0f)
471
+ ]],
472
+
473
+ uniform texture_2d coat_anisotropy_rotation_image = texture_2d() [[
474
+ anno::display_name("Anisotropy Rotation Image"),
475
+ anno::in_group("Coat"),
476
+ anno::usage("anisotropy_rotation")
477
+ ]],
478
+
479
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_rotation_image_alpha_mode =
480
+ ::OmniSurface::OmniImage::alpha_default [[
481
+ anno::display_name("Anisotropy Rotation Image Alpha Mode"),
482
+ anno::in_group("Coat")
483
+ ]],
484
+
485
+ float coat_affect_color = float(0.0) [[
486
+ anno::display_name("Affect Color"),
487
+ anno::in_group("Coat"),
488
+ anno::hard_range(0.0f, 1.0f)
489
+ ]],
490
+
491
+ uniform texture_2d coat_affect_color_image = texture_2d() [[
492
+ anno::display_name("Affect Color Image"),
493
+ anno::in_group("Coat")
494
+ ]],
495
+
496
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_color_image_alpha_mode =
497
+ ::OmniSurface::OmniImage::alpha_default [[
498
+ anno::display_name("Affect Color Image Alpha Mode"),
499
+ anno::in_group("Coat")
500
+ ]],
501
+
502
+ float coat_affect_roughness = float(0.0) [[
503
+ anno::display_name("Affect Roughness"),
504
+ anno::in_group("Coat"),
505
+ anno::hard_range(0.0f, 1.0f)
506
+ ]],
507
+
508
+ uniform texture_2d coat_affect_roughness_image = texture_2d() [[
509
+ anno::display_name("Affect Roughness Image"),
510
+ anno::in_group("Coat"),
511
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
512
+ ]],
513
+
514
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_roughness_image_alpha_mode =
515
+ ::OmniSurface::OmniImage::alpha_default [[
516
+ anno::display_name("Affect Roughness Alpha Mode"),
517
+ anno::in_group("Coat")
518
+ ]],
519
+
520
+ uniform float coat_normal_strength = float(1.0) [[
521
+ anno::display_name("Normal Strength"),
522
+ anno::in_group("Coat"),
523
+ anno::soft_range(0.0f, 1.0f),
524
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
525
+ ]],
526
+
527
+ float3 coat_normal = state::normal() [[
528
+ anno::display_name("Normal"),
529
+ anno::in_group("Coat"),
530
+ anno::usage("normal")
531
+ ]],
532
+
533
+ uniform texture_2d coat_normal_image = texture_2d() [[
534
+ anno::display_name("Normal Map Image"),
535
+ anno::in_group("Coat"),
536
+ anno::usage("normal")
537
+ ]],
538
+
539
+ uniform bool coat_normal_image_flip_r_channel = false [[
540
+ anno::display_name("Normal Map Flip R Channel"),
541
+ anno::in_group("Coat")
542
+ ]],
543
+
544
+ uniform bool coat_normal_image_flip_g_channel = false [[
545
+ anno::display_name("Normal Map Flip G Channel"),
546
+ anno::in_group("Coat")
547
+ ]],
548
+
549
+ uniform bool coat_normal_image_flip_b_channel = false [[
550
+ anno::display_name("Normal Map Flip B Channel"),
551
+ anno::in_group("Coat")
552
+ ]],
553
+
554
+ //Specular retro-reflection
555
+ //
556
+ float specular_retro_reflection_weight = float(0.0) [[
557
+ anno::display_name("Weight"),
558
+ anno::in_group("Sheen"),
559
+ anno::hard_range(0.0f, 1.0f)
560
+ ]],
561
+
562
+ uniform texture_2d specular_retro_reflection_weight_image = texture_2d() [[
563
+ anno::display_name("Weight Image"),
564
+ anno::in_group("Sheen"),
565
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
566
+ ]],
567
+
568
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_retro_reflection_weight_image_alpha_mode =
569
+ ::OmniSurface::OmniImage::alpha_default [[
570
+ anno::display_name("Weight Image Alpha Mode"),
571
+ anno::in_group("Sheen")
572
+ ]],
573
+
574
+ color specular_retro_reflection_color = color(1.0) [[
575
+ anno::display_name("Color"),
576
+ anno::in_group("Sheen")
577
+ ]],
578
+
579
+ uniform texture_2d specular_retro_reflection_color_image = texture_2d() [[
580
+ anno::display_name("Color Image"),
581
+ anno::in_group("Sheen")
582
+ ]],
583
+
584
+ float specular_retro_reflection_roughness = float(0.3) [[
585
+ anno::display_name("Roughness"),
586
+ anno::in_group("Sheen"),
587
+ anno::hard_range(0.0f, 1.0f)
588
+ ]],
589
+
590
+ uniform texture_2d specular_retro_reflection_roughness_image = texture_2d() [[
591
+ anno::display_name("Roughness Image"),
592
+ anno::in_group("Sheen"),
593
+ anno::usage("roughness")
594
+ ]],
595
+
596
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_retro_reflection_roughness_image_alpha_mode =
597
+ ::OmniSurface::OmniImage::alpha_default [[
598
+ anno::display_name("Roughness Image Alpha Mode"),
599
+ anno::in_group("Sheen")
600
+ ]],
601
+
602
+ //Emission
603
+ //
604
+ float emission_weight = float(0.0) [[
605
+ anno::display_name("Weight"),
606
+ anno::in_group("Emission"),
607
+ anno::hard_range(0.0f, 1.0f)
608
+ ]],
609
+
610
+ uniform texture_2d emission_weight_image = texture_2d() [[
611
+ anno::display_name("Weight Image"),
612
+ anno::in_group("Emission"),
613
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
614
+ ]],
615
+
616
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_weight_image_alpha_mode =
617
+ ::OmniSurface::OmniImage::alpha_default [[
618
+ anno::display_name("Weight Image Alpha Mode"),
619
+ anno::in_group("Emission")
620
+ ]],
621
+
622
+ uniform ::OmniSurface::OmniShared::emission_mode emission_mode =
623
+ ::OmniSurface::OmniShared::emission_lx [[
624
+ anno::display_name("Emission Mode"),
625
+ anno::in_group("Emission")
626
+ ]],
627
+
628
+ float emission_intensity = float(1.0) [[
629
+ anno::display_name("Intensity"),
630
+ anno::in_group("Emission"),
631
+ anno::soft_range(0.0f, 1000.0f)
632
+ ]],
633
+
634
+ uniform texture_2d emission_intensity_image = texture_2d() [[
635
+ anno::display_name("Intensity Image"),
636
+ anno::in_group("Emission"),
637
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
638
+ ]],
639
+
640
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_intensity_image_alpha_mode =
641
+ ::OmniSurface::OmniImage::alpha_default [[
642
+ anno::display_name("Intensity Image Alpha Mode"),
643
+ anno::in_group("Emission")
644
+ ]],
645
+
646
+ color emission_color = color(1.0) [[
647
+ anno::display_name("Color"),
648
+ anno::in_group("Emission")
649
+ ]],
650
+
651
+ uniform texture_2d emission_color_image = texture_2d() [[
652
+ anno::display_name("Color Image"),
653
+ anno::in_group("Emission")
654
+ ]],
655
+
656
+ uniform bool emission_use_temperature = false [[
657
+ anno::display_name("Use Temperature"),
658
+ anno::in_group("Emission")
659
+ ]],
660
+
661
+ float emission_temperature = float(6500.0) [[
662
+ anno::display_name("Temperature (kelvin)"),
663
+ anno::in_group("Emission"),
664
+ anno::soft_range(0.0f, 10000.0f)
665
+ ]],
666
+
667
+ uniform texture_2d emission_temperature_image = texture_2d() [[
668
+ anno::display_name("Temperature Image"),
669
+ anno::in_group("Emission"),
670
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
671
+ ]],
672
+
673
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_temperature_image_alpha_mode =
674
+ ::OmniSurface::OmniImage::alpha_default [[
675
+ anno::display_name("Temperature Image Alpha Mode"),
676
+ anno::in_group("Emission")
677
+ ]],
678
+
679
+ //Thin Film
680
+ //
681
+ uniform bool enable_thin_film = false [[
682
+ anno::display_name("Enable Thin Film"),
683
+ anno::description("Enable the use of thin film"),
684
+ anno::in_group("Thin Film")
685
+ ]],
686
+
687
+ float thin_film_thickness = float(400.0) [[
688
+ anno::display_name("Thickness (nm)"),
689
+ anno::in_group("Thin Film"),
690
+ anno::soft_range(0.0f, 2000.0f),
691
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
692
+ ]],
693
+
694
+ uniform texture_2d thin_film_thickness_image = texture_2d() [[
695
+ anno::display_name("Thickness Image"),
696
+ anno::in_group("Thin Film"),
697
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
698
+ ]],
699
+
700
+ uniform ::OmniSurface::OmniImage::alpha_mode thin_film_thickness_image_alpha_mode =
701
+ ::OmniSurface::OmniImage::alpha_default [[
702
+ anno::display_name("Thickness Image Alpha Mode"),
703
+ anno::in_group("Thin Film")
704
+ ]],
705
+
706
+ uniform ::OmniSurface::OmniShared::ior_presets thin_film_ior_preset =
707
+ ::OmniSurface::OmniShared::ior_custom [[
708
+ anno::display_name("IOR Preset"),
709
+ anno::in_group("Thin Film")
710
+ ]],
711
+
712
+ uniform float thin_film_ior = float(1.5) [[
713
+ anno::display_name("IOR"),
714
+ anno::in_group("Thin Film"),
715
+ anno::soft_range(1.0f, 3.0f),
716
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
717
+ ]],
718
+
719
+ //Geometry
720
+ //
721
+ uniform bool thin_walled = false [[
722
+ anno::display_name("Thin Walled"),
723
+ anno::description("Thin surface with no interior."),
724
+ anno::in_group("Geometry")
725
+ ]],
726
+
727
+ uniform bool enable_opacity = false [[
728
+ anno::display_name("Enable Opacity"),
729
+ anno::description("Enables the use of cutout opacity"),
730
+ anno::in_group("Geometry")
731
+ ]],
732
+
733
+ float geometry_opacity = float(1.0) [[
734
+ anno::display_name("Opacity"),
735
+ anno::in_group("Geometry"),
736
+ anno::hard_range(0.0f, 1.0f)
737
+ ]],
738
+
739
+ uniform texture_2d geometry_opacity_image = texture_2d() [[
740
+ anno::display_name("Opacity Image"),
741
+ anno::in_group("Geometry"),
742
+ anno::usage("opacity")
743
+ ]],
744
+
745
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_opacity_image_alpha_mode =
746
+ ::OmniSurface::OmniImage::alpha_default [[
747
+ anno::display_name("Opacity Image Alpha Mode"),
748
+ anno::in_group("Geometry")
749
+ ]],
750
+
751
+ uniform float geometry_opacity_threshold = float(0.0) [[
752
+ anno::display_name("Opacity Threshold"),
753
+ anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
754
+ anno::in_group("Geometry"),
755
+ anno::hard_range(0.0f, 1.0f)
756
+ ]],
757
+
758
+ uniform float geometry_normal_strength = float(1.0) [[
759
+ anno::display_name("Geometry Normal Strength"),
760
+ anno::in_group("Geometry"),
761
+ anno::soft_range(0.0f, 1.0f),
762
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
763
+ ]],
764
+
765
+ uniform float geometry_normal_roughness_strength = float(1.0) [[
766
+ anno::display_name("Geometry Normal Roughness Strength"),
767
+ anno::in_group("Geometry"),
768
+ anno::hard_range(0.0f, 1.0f)
769
+ ]],
770
+
771
+ float3 geometry_normal = state::normal() [[
772
+ anno::display_name("Geometry Normal"),
773
+ anno::in_group("Geometry"),
774
+ anno::usage("normal")
775
+ ]],
776
+
777
+ uniform texture_2d geometry_normal_image = texture_2d() [[
778
+ anno::display_name("Geometry Normal Map Image"),
779
+ anno::in_group("Geometry"),
780
+ anno::usage("normal")
781
+ ]],
782
+
783
+ uniform bool geometry_normal_image_flip_r_channel = false [[
784
+ anno::display_name("Normal Map Flip R Channel"),
785
+ anno::in_group("Geometry")
786
+ ]],
787
+
788
+ uniform bool geometry_normal_image_flip_g_channel = false [[
789
+ anno::display_name("Normal Map Flip G Channel"),
790
+ anno::in_group("Geometry")
791
+ ]],
792
+
793
+ uniform bool geometry_normal_image_flip_b_channel = false [[
794
+ anno::display_name("Normal Map Flip B Channel"),
795
+ anno::in_group("Geometry")
796
+ ]],
797
+
798
+ uniform ::OmniSurface::OmniImage::tangent_bitangent_mapping geometry_tangent_bitangent_mapping =
799
+ ::OmniSurface::OmniImage::red_green [[
800
+ anno::display_name("Tangent Bitangent Mapping"),
801
+ anno::in_group("Geometry")
802
+ ]],
803
+
804
+ //Displacement
805
+ float3 geometry_displacement = float3(0.0) [[
806
+ anno::display_name("Displacement"),
807
+ anno::in_group("Geometry")
808
+ ]],
809
+
810
+ uniform ::OmniSurface::OmniShared::displacement_mode geometry_displacement_mode =
811
+ ::OmniSurface::OmniShared::displacement_height [[
812
+ anno::display_name("Displacement Mode"),
813
+ anno::in_group("Geometry")
814
+ ]],
815
+
816
+ uniform texture_2d geometry_displacement_image = texture_2d() [[
817
+ anno::display_name("Displacement Image"),
818
+ anno::in_group("Geometry"),
819
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
820
+ ]],
821
+
822
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_image_alpha_mode =
823
+ ::OmniSurface::OmniImage::alpha_default [[
824
+ anno::display_name("Displacement Image Alpha Mode"),
825
+ anno::in_group("Geometry")
826
+ ]],
827
+
828
+ float geometry_displacement_scale = float(1.0) [[
829
+ anno::display_name("Displacement Scale"),
830
+ anno::in_group("Geometry"),
831
+ anno::soft_range(0.0f, 1.0f)
832
+ ]],
833
+
834
+ uniform texture_2d geometry_displacement_scale_image = texture_2d() [[
835
+ anno::display_name("Displacement Scale Image"),
836
+ anno::in_group("Geometry"),
837
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
838
+ ]],
839
+
840
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_scale_image_alpha_mode =
841
+ ::OmniSurface::OmniImage::alpha_default [[
842
+ anno::display_name("Displacement Scale Image Alpha Mode"),
843
+ anno::in_group("Geometry")
844
+ ]],
845
+
846
+ float geometry_displacement_scalar_zero_value = float(0.0) [[
847
+ anno::display_name("Displacement Scalar Zero Value"),
848
+ anno::in_group("Geometry"),
849
+ anno::soft_range(0.0f, 1.0f)
850
+ ]],
851
+
852
+ //UVW
853
+ //
854
+ uniform base::texture_coordinate_system uvw_texture_coordinate_system =
855
+ base::texture_coordinate_uvw [[
856
+ anno::display_name("Texture Coordinate"),
857
+ anno::in_group("UVW Coordinates")
858
+ ]],
859
+
860
+ uniform int uvw_uv_set = 0 [[
861
+ anno::display_name("UV Set"),
862
+ anno::in_group("UVW Coordinates"),
863
+ anno::hard_range(0, 4)
864
+ ]],
865
+
866
+ uniform bool uvw_ignore_missing_textures = false [[
867
+ anno::display_name("Ignore Missing Images"),
868
+ anno::in_group("UVW Coordinates")
869
+ ]],
870
+
871
+ color uvw_missing_texture_color = color(0.0, 0.0, 0.0) [[
872
+ anno::display_name("Missing Image Color"),
873
+ anno::in_group("UVW Coordinates")
874
+ ]],
875
+
876
+ uniform bool uvw_use_uv_coords = false [[
877
+ anno::display_name("Use UV Coords"),
878
+ anno::in_group("UVW Coordinates")
879
+ ]],
880
+
881
+ float2 uvw_uv_coords = float2(0.0) [[
882
+ anno::display_name("UV Coords"),
883
+ anno::in_group("UVW Coordinates")
884
+ ]],
885
+
886
+ uniform float uvw_s_offset = 0.0f [[
887
+ anno::display_name("Offset U"),
888
+ anno::in_group("UVW Coordinates"),
889
+ anno::soft_range(-1.0f, 1.0f)
890
+ ]],
891
+
892
+ uniform float uvw_t_offset = 0.0f [[
893
+ anno::display_name("Offset V"),
894
+ anno::in_group("UVW Coordinates"),
895
+ anno::soft_range(-1.0f, 1.0f)
896
+ ]],
897
+
898
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_s_wrap =
899
+ ::OmniSurface::OmniImage::wrap_periodic [[
900
+ anno::display_name("Wrap U"),
901
+ anno::in_group("UVW Coordinates")
902
+ ]],
903
+
904
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_t_wrap =
905
+ ::OmniSurface::OmniImage::wrap_periodic [[
906
+ anno::display_name("Wrap V"),
907
+ anno::in_group("UVW Coordinates")
908
+ ]],
909
+
910
+ uniform float uvw_s_scale = 1.0f [[
911
+ anno::display_name("Scale U"),
912
+ anno::in_group("UVW Coordinates"),
913
+ anno::soft_range(0.0f, 100.0f)
914
+ ]],
915
+
916
+ uniform float uvw_t_scale = 1.0f [[
917
+ anno::display_name("Scale V"),
918
+ anno::in_group("UVW Coordinates"),
919
+ anno::soft_range(0.0f, 100.0f)
920
+ ]],
921
+
922
+ uniform bool uvw_s_flip = false [[
923
+ anno::display_name("Flip U"),
924
+ anno::in_group("UVW Coordinates")
925
+ ]],
926
+
927
+ uniform bool uvw_t_flip = false [[
928
+ anno::display_name("Flip V"),
929
+ anno::in_group("UVW Coordinates")
930
+ ]],
931
+
932
+ uniform bool uvw_swap_st = false [[
933
+ anno::display_name("Swap UV"),
934
+ anno::in_group("UVW Coordinates")
935
+ ]],
936
+
937
+ //Projection Coordinates (Local / World)
938
+ uniform ::OmniSurface::OmniImage::projection_mode uvw_projection_mode =
939
+ ::OmniSurface::OmniImage::projection_cubic [[
940
+ anno::display_name("Projection Mode"),
941
+ anno::in_group("UVW Coordinates")
942
+ ]],
943
+
944
+ uniform float3 uvw_projection_translate = float3(0.0) [[
945
+ anno::display_name("Translate"),
946
+ anno::description("Translate the projected texture."),
947
+ anno::in_group("UVW Coordinates")
948
+ ]],
949
+
950
+ uniform float3 uvw_projection_rotate = float3(0.0) [[
951
+ anno::display_name("Rotate"),
952
+ anno::description("Rotate the projected texture."),
953
+ anno::in_group("UVW Coordinates")
954
+ ]],
955
+
956
+ uniform float3 uvw_projection_scale = float3(1.0) [[
957
+ anno::display_name("Scale"),
958
+ anno::description("Scale the projected texture."),
959
+ anno::in_group("UVW Coordinates")
960
+ ]]
961
+ )
962
+ [[
963
+ anno::display_name("OmniSurface"),
964
+ anno::description("A base material for modeling a variety of surfaces."),
965
+ anno::author("NVIDIA Corporation"),
966
+ anno::key_words(string[]("generic", "surface")),
967
+ anno::version(1, 0, 0, ""),
968
+ anno::in_group("Advanced")
969
+ ]] = let {
970
+
971
+ base::texture_coordinate_info texture_coordinate_info =
972
+ ::OmniSurface::OmniImage::compute_texture_coordinate_2(
973
+ uvw_texture_coordinate_system,
974
+ uvw_uv_set,
975
+ uvw_s_offset,
976
+ uvw_t_offset,
977
+ uvw_s_scale,
978
+ uvw_t_scale,
979
+ uvw_s_flip,
980
+ uvw_t_flip,
981
+ uvw_swap_st,
982
+ uvw_projection_mode,
983
+ uvw_projection_translate,
984
+ uvw_projection_rotate,
985
+ uvw_projection_scale);
986
+
987
+ ::OmniSurface::OmniImage::normal_roughness_data geometry_normal_roughness_data =
988
+ tex::texture_isvalid(geometry_normal_image) ?
989
+ ::OmniSurface::OmniImage::tangent_space_normal_roughness_lookup_2(
990
+ geometry_normal_image,
991
+ uvw_ignore_missing_textures,
992
+ uvw_use_uv_coords,
993
+ uvw_uv_coords,
994
+ uvw_s_wrap,
995
+ uvw_t_wrap,
996
+ uvw_s_flip,
997
+ uvw_t_flip,
998
+ geometry_normal_strength,
999
+ geometry_normal_image_flip_r_channel,
1000
+ geometry_normal_image_flip_g_channel,
1001
+ geometry_normal_image_flip_b_channel,
1002
+ texture_coordinate_info
1003
+ ) :
1004
+ ::OmniSurface::OmniImage::normal_roughness_data(geometry_normal, float2(0.0));
1005
+
1006
+ material base = ::OmniSurface::OmniSurfaceBase::OmniSurfaceBase(
1007
+
1008
+ //Base
1009
+ //
1010
+ diffuse_reflection_weight: tex::texture_isvalid(diffuse_reflection_weight_image) ?
1011
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1012
+ ::OmniSurface::OmniImage::texture_lookup_2(
1013
+ diffuse_reflection_weight_image,
1014
+ uvw_ignore_missing_textures,
1015
+ uvw_missing_texture_color,
1016
+ uvw_use_uv_coords,
1017
+ uvw_uv_coords,
1018
+ uvw_s_wrap,
1019
+ uvw_t_wrap,
1020
+ texture_coordinate_info
1021
+ ),
1022
+ diffuse_reflection_weight_image_alpha_mode
1023
+ ).mono :
1024
+ diffuse_reflection_weight,
1025
+
1026
+ diffuse_reflection_color: tex::texture_isvalid(diffuse_reflection_color_image) ?
1027
+ ::OmniSurface::OmniImage::texture_lookup_2(
1028
+ diffuse_reflection_color_image,
1029
+ uvw_ignore_missing_textures,
1030
+ uvw_missing_texture_color,
1031
+ uvw_use_uv_coords,
1032
+ uvw_uv_coords,
1033
+ uvw_s_wrap,
1034
+ uvw_t_wrap,
1035
+ texture_coordinate_info
1036
+ ).tint :
1037
+ diffuse_reflection_color,
1038
+
1039
+ diffuse_reflection_roughness: tex::texture_isvalid(diffuse_reflection_roughness_image) ?
1040
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1041
+ ::OmniSurface::OmniImage::texture_lookup_2(
1042
+ diffuse_reflection_roughness_image,
1043
+ uvw_ignore_missing_textures,
1044
+ uvw_missing_texture_color,
1045
+ uvw_use_uv_coords,
1046
+ uvw_uv_coords,
1047
+ uvw_s_wrap,
1048
+ uvw_t_wrap,
1049
+ texture_coordinate_info
1050
+ ),
1051
+ diffuse_reflection_roughness_image_alpha_mode
1052
+ ).mono :
1053
+ diffuse_reflection_roughness,
1054
+
1055
+ //Metalness
1056
+ //
1057
+ metalness: tex::texture_isvalid(metalness_image) ?
1058
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1059
+ ::OmniSurface::OmniImage::texture_lookup_2(
1060
+ metalness_image,
1061
+ uvw_ignore_missing_textures,
1062
+ uvw_missing_texture_color,
1063
+ uvw_use_uv_coords,
1064
+ uvw_uv_coords,
1065
+ uvw_s_wrap,
1066
+ uvw_t_wrap,
1067
+ texture_coordinate_info
1068
+ ),
1069
+ metalness_image_alpha_mode
1070
+ ).mono :
1071
+ metalness,
1072
+
1073
+ //Specular reflection
1074
+ //
1075
+ specular_reflection_weight: tex::texture_isvalid(specular_reflection_weight_image) ?
1076
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1077
+ ::OmniSurface::OmniImage::texture_lookup_2(
1078
+ specular_reflection_weight_image,
1079
+ uvw_ignore_missing_textures,
1080
+ uvw_missing_texture_color,
1081
+ uvw_use_uv_coords,
1082
+ uvw_uv_coords,
1083
+ uvw_s_wrap,
1084
+ uvw_t_wrap,
1085
+ texture_coordinate_info
1086
+ ),
1087
+ specular_reflection_weight_image_alpha_mode
1088
+ ).mono :
1089
+ specular_reflection_weight,
1090
+
1091
+ specular_reflection_color: tex::texture_isvalid(specular_reflection_color_image) ?
1092
+ ::OmniSurface::OmniImage::texture_lookup_2(
1093
+ specular_reflection_color_image,
1094
+ uvw_ignore_missing_textures,
1095
+ uvw_missing_texture_color,
1096
+ uvw_use_uv_coords,
1097
+ uvw_uv_coords,
1098
+ uvw_s_wrap,
1099
+ uvw_t_wrap,
1100
+ texture_coordinate_info
1101
+ ).tint :
1102
+ specular_reflection_color,
1103
+
1104
+ specular_reflection_roughness: tex::texture_isvalid(specular_reflection_roughness_image) ?
1105
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1106
+ ::OmniSurface::OmniImage::texture_lookup_2(
1107
+ specular_reflection_roughness_image,
1108
+ uvw_ignore_missing_textures,
1109
+ uvw_missing_texture_color,
1110
+ uvw_use_uv_coords,
1111
+ uvw_uv_coords,
1112
+ uvw_s_wrap,
1113
+ uvw_t_wrap,
1114
+ texture_coordinate_info
1115
+ ),
1116
+ specular_reflection_roughness_image_alpha_mode
1117
+ ).mono :
1118
+ specular_reflection_roughness,
1119
+
1120
+ specular_reflection_ior_preset: specular_reflection_ior_preset,
1121
+ specular_reflection_ior: specular_reflection_ior,
1122
+
1123
+ specular_reflection_anisotropy: tex::texture_isvalid(specular_reflection_anisotropy_image) ?
1124
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1125
+ ::OmniSurface::OmniImage::texture_lookup_2(
1126
+ specular_reflection_anisotropy_image,
1127
+ uvw_ignore_missing_textures,
1128
+ uvw_missing_texture_color,
1129
+ uvw_use_uv_coords,
1130
+ uvw_uv_coords,
1131
+ uvw_s_wrap,
1132
+ uvw_t_wrap,
1133
+ texture_coordinate_info
1134
+ ),
1135
+ specular_reflection_anisotropy_image_alpha_mode
1136
+ ).mono :
1137
+ specular_reflection_anisotropy,
1138
+
1139
+ specular_reflection_anisotropy_rotation: tex::texture_isvalid(specular_reflection_anisotropy_rotation_image) ?
1140
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1141
+ ::OmniSurface::OmniImage::texture_lookup_2(
1142
+ specular_reflection_anisotropy_rotation_image,
1143
+ uvw_ignore_missing_textures,
1144
+ uvw_missing_texture_color,
1145
+ uvw_use_uv_coords,
1146
+ uvw_uv_coords,
1147
+ uvw_s_wrap,
1148
+ uvw_t_wrap,
1149
+ texture_coordinate_info
1150
+ ),
1151
+ specular_reflection_anisotropy_rotation_image_alpha_mode
1152
+ ).mono :
1153
+ specular_reflection_anisotropy_rotation,
1154
+
1155
+ //Specular transmission
1156
+ //
1157
+ enable_specular_transmission: enable_specular_transmission,
1158
+
1159
+ specular_transmission_weight: tex::texture_isvalid(specular_transmission_weight_image) ?
1160
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1161
+ ::OmniSurface::OmniImage::texture_lookup_2(
1162
+ specular_transmission_weight_image,
1163
+ uvw_ignore_missing_textures,
1164
+ uvw_missing_texture_color,
1165
+ uvw_use_uv_coords,
1166
+ uvw_uv_coords,
1167
+ uvw_s_wrap,
1168
+ uvw_t_wrap,
1169
+ texture_coordinate_info
1170
+ ),
1171
+ specular_transmission_weight_image_alpha_mode
1172
+ ).mono :
1173
+ specular_transmission_weight,
1174
+
1175
+ specular_transmission_color: tex::texture_isvalid(specular_transmission_color_image) ?
1176
+ ::OmniSurface::OmniImage::texture_lookup_2(
1177
+ specular_transmission_color_image,
1178
+ uvw_ignore_missing_textures,
1179
+ uvw_missing_texture_color,
1180
+ uvw_use_uv_coords,
1181
+ uvw_uv_coords,
1182
+ uvw_s_wrap,
1183
+ uvw_t_wrap,
1184
+ texture_coordinate_info
1185
+ ).tint :
1186
+ specular_transmission_color,
1187
+
1188
+ specular_transmission_scattering_depth: tex::texture_isvalid(specular_transmission_scattering_depth_image) ?
1189
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1190
+ ::OmniSurface::OmniImage::texture_lookup_2(
1191
+ specular_transmission_scattering_depth_image,
1192
+ uvw_ignore_missing_textures,
1193
+ uvw_missing_texture_color,
1194
+ uvw_use_uv_coords,
1195
+ uvw_uv_coords,
1196
+ uvw_s_wrap,
1197
+ uvw_t_wrap,
1198
+ texture_coordinate_info
1199
+ ),
1200
+ specular_transmission_scattering_depth_image_alpha_mode
1201
+ ).mono :
1202
+ specular_transmission_scattering_depth,
1203
+
1204
+ specular_transmission_scattering_color: tex::texture_isvalid(specular_transmission_scattering_color_image) ?
1205
+ ::OmniSurface::OmniImage::texture_lookup_2(
1206
+ specular_transmission_scattering_color_image,
1207
+ uvw_ignore_missing_textures,
1208
+ uvw_missing_texture_color,
1209
+ uvw_use_uv_coords,
1210
+ uvw_uv_coords,
1211
+ uvw_s_wrap,
1212
+ uvw_t_wrap,
1213
+ texture_coordinate_info
1214
+ ).tint :
1215
+ specular_transmission_scattering_color,
1216
+
1217
+ specular_transmission_scatter_anisotropy: tex::texture_isvalid(specular_transmission_scatter_anisotropy_image) ?
1218
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1219
+ ::OmniSurface::OmniImage::texture_lookup_2(
1220
+ specular_transmission_scatter_anisotropy_image,
1221
+ uvw_ignore_missing_textures,
1222
+ uvw_missing_texture_color,
1223
+ uvw_use_uv_coords,
1224
+ uvw_uv_coords,
1225
+ uvw_s_wrap,
1226
+ uvw_t_wrap,
1227
+ texture_coordinate_info
1228
+ ),
1229
+ specular_transmission_scatter_anisotropy_image_alpha_mode
1230
+ ).mono :
1231
+ specular_transmission_scatter_anisotropy,
1232
+
1233
+ specular_transmission_dispersion_abbe: specular_transmission_dispersion_abbe,
1234
+
1235
+ //Subsurface
1236
+ //
1237
+ enable_diffuse_transmission: enable_diffuse_transmission,
1238
+
1239
+ subsurface_weight: tex::texture_isvalid(subsurface_weight_image) ?
1240
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1241
+ ::OmniSurface::OmniImage::texture_lookup_2(
1242
+ subsurface_weight_image,
1243
+ uvw_ignore_missing_textures,
1244
+ uvw_missing_texture_color,
1245
+ uvw_use_uv_coords,
1246
+ uvw_uv_coords,
1247
+ uvw_s_wrap,
1248
+ uvw_t_wrap,
1249
+ texture_coordinate_info
1250
+ ),
1251
+ subsurface_weight_image_alpha_mode
1252
+ ).mono :
1253
+ subsurface_weight,
1254
+
1255
+ subsurface_scattering_colors_preset: subsurface_scattering_colors_preset,
1256
+
1257
+ subsurface_transmission_color: tex::texture_isvalid(subsurface_transmission_color_image) ?
1258
+ ::OmniSurface::OmniImage::texture_lookup_2(
1259
+ subsurface_transmission_color_image,
1260
+ uvw_ignore_missing_textures,
1261
+ uvw_missing_texture_color,
1262
+ uvw_use_uv_coords,
1263
+ uvw_uv_coords,
1264
+ uvw_s_wrap,
1265
+ uvw_t_wrap,
1266
+ texture_coordinate_info
1267
+ ).tint :
1268
+ subsurface_transmission_color,
1269
+
1270
+ subsurface_scattering_color: tex::texture_isvalid(subsurface_scattering_color_image) ?
1271
+ ::OmniSurface::OmniImage::texture_lookup_2(
1272
+ subsurface_scattering_color_image,
1273
+ uvw_ignore_missing_textures,
1274
+ uvw_missing_texture_color,
1275
+ uvw_use_uv_coords,
1276
+ uvw_uv_coords,
1277
+ uvw_s_wrap,
1278
+ uvw_t_wrap,
1279
+ texture_coordinate_info
1280
+ ).tint :
1281
+ subsurface_scattering_color,
1282
+
1283
+ subsurface_scale: tex::texture_isvalid(subsurface_scale_image) ?
1284
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1285
+ ::OmniSurface::OmniImage::texture_lookup_2(
1286
+ subsurface_scale_image,
1287
+ uvw_ignore_missing_textures,
1288
+ uvw_missing_texture_color,
1289
+ uvw_use_uv_coords,
1290
+ uvw_uv_coords,
1291
+ uvw_s_wrap,
1292
+ uvw_t_wrap,
1293
+ texture_coordinate_info
1294
+ ),
1295
+ subsurface_scale_image_alpha_mode
1296
+ ).mono :
1297
+ subsurface_scale,
1298
+
1299
+ subsurface_anisotropy: tex::texture_isvalid(subsurface_anisotropy_image) ?
1300
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1301
+ ::OmniSurface::OmniImage::texture_lookup_2(
1302
+ subsurface_anisotropy_image,
1303
+ uvw_ignore_missing_textures,
1304
+ uvw_missing_texture_color,
1305
+ uvw_use_uv_coords,
1306
+ uvw_uv_coords,
1307
+ uvw_s_wrap,
1308
+ uvw_t_wrap,
1309
+ texture_coordinate_info
1310
+ ),
1311
+ subsurface_anisotropy_image_alpha_mode
1312
+ ).mono :
1313
+ subsurface_anisotropy,
1314
+
1315
+ //Coat
1316
+ //
1317
+ coat_weight: tex::texture_isvalid(coat_weight_image) ?
1318
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1319
+ ::OmniSurface::OmniImage::texture_lookup_2(
1320
+ coat_weight_image,
1321
+ uvw_ignore_missing_textures,
1322
+ uvw_missing_texture_color,
1323
+ uvw_use_uv_coords,
1324
+ uvw_uv_coords,
1325
+ uvw_s_wrap,
1326
+ uvw_t_wrap,
1327
+ texture_coordinate_info
1328
+ ),
1329
+ coat_weight_image_alpha_mode
1330
+ ).mono :
1331
+ coat_weight,
1332
+
1333
+ coat_color: tex::texture_isvalid(coat_color_image) ?
1334
+ ::OmniSurface::OmniImage::texture_lookup_2(
1335
+ coat_color_image,
1336
+ uvw_ignore_missing_textures,
1337
+ uvw_missing_texture_color,
1338
+ uvw_use_uv_coords,
1339
+ uvw_uv_coords,
1340
+ uvw_s_wrap,
1341
+ uvw_t_wrap,
1342
+ texture_coordinate_info
1343
+ ).tint :
1344
+ coat_color,
1345
+
1346
+ coat_roughness: tex::texture_isvalid(coat_roughness_image) ?
1347
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1348
+ ::OmniSurface::OmniImage::texture_lookup_2(
1349
+ coat_roughness_image,
1350
+ uvw_ignore_missing_textures,
1351
+ uvw_missing_texture_color,
1352
+ uvw_use_uv_coords,
1353
+ uvw_uv_coords,
1354
+ uvw_s_wrap,
1355
+ uvw_t_wrap,
1356
+ texture_coordinate_info
1357
+ ),
1358
+ coat_roughness_image_alpha_mode
1359
+ ).mono :
1360
+ coat_roughness,
1361
+
1362
+ coat_ior_preset: coat_ior_preset,
1363
+ coat_ior: coat_ior,
1364
+
1365
+ coat_anisotropy: tex::texture_isvalid(coat_anisotropy_image) ?
1366
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1367
+ ::OmniSurface::OmniImage::texture_lookup_2(
1368
+ coat_anisotropy_image,
1369
+ uvw_ignore_missing_textures,
1370
+ uvw_missing_texture_color,
1371
+ uvw_use_uv_coords,
1372
+ uvw_uv_coords,
1373
+ uvw_s_wrap,
1374
+ uvw_t_wrap,
1375
+ texture_coordinate_info
1376
+ ),
1377
+ coat_anisotropy_image_alpha_mode
1378
+ ).mono :
1379
+ coat_anisotropy,
1380
+
1381
+ coat_anisotropy_rotation: tex::texture_isvalid(coat_anisotropy_rotation_image) ?
1382
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1383
+ ::OmniSurface::OmniImage::texture_lookup_2(
1384
+ coat_anisotropy_rotation_image,
1385
+ uvw_ignore_missing_textures,
1386
+ uvw_missing_texture_color,
1387
+ uvw_use_uv_coords,
1388
+ uvw_uv_coords,
1389
+ uvw_s_wrap,
1390
+ uvw_t_wrap,
1391
+ texture_coordinate_info
1392
+ ),
1393
+ coat_anisotropy_rotation_image_alpha_mode
1394
+ ).mono :
1395
+ coat_anisotropy_rotation,
1396
+
1397
+ coat_affect_color: tex::texture_isvalid(coat_affect_color_image) ?
1398
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1399
+ ::OmniSurface::OmniImage::texture_lookup_2(
1400
+ coat_affect_color_image,
1401
+ uvw_ignore_missing_textures,
1402
+ uvw_missing_texture_color,
1403
+ uvw_use_uv_coords,
1404
+ uvw_uv_coords,
1405
+ uvw_s_wrap,
1406
+ uvw_t_wrap,
1407
+ texture_coordinate_info
1408
+ ),
1409
+ coat_affect_color_image_alpha_mode
1410
+ ).mono :
1411
+ coat_affect_color,
1412
+
1413
+ coat_affect_roughness: tex::texture_isvalid(coat_affect_roughness_image) ?
1414
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1415
+ ::OmniSurface::OmniImage::texture_lookup_2(
1416
+ coat_affect_roughness_image,
1417
+ uvw_ignore_missing_textures,
1418
+ uvw_missing_texture_color,
1419
+ uvw_use_uv_coords,
1420
+ uvw_uv_coords,
1421
+ uvw_s_wrap,
1422
+ uvw_t_wrap,
1423
+ texture_coordinate_info
1424
+ ),
1425
+ coat_affect_roughness_image_alpha_mode
1426
+ ).mono :
1427
+ coat_affect_roughness,
1428
+
1429
+ coat_normal: tex::texture_isvalid(coat_normal_image) ?
1430
+ ::OmniSurface::OmniImage::normal_mapping(
1431
+ ::OmniSurface::OmniImage::tangent_space_normal_lookup_2(
1432
+ coat_normal_image,
1433
+ uvw_ignore_missing_textures,
1434
+ uvw_use_uv_coords,
1435
+ uvw_uv_coords,
1436
+ uvw_s_wrap,
1437
+ uvw_t_wrap,
1438
+ uvw_s_flip,
1439
+ uvw_t_flip,
1440
+ coat_normal_strength,
1441
+ coat_normal_image_flip_r_channel,
1442
+ coat_normal_image_flip_g_channel,
1443
+ coat_normal_image_flip_b_channel,
1444
+ texture_coordinate_info
1445
+ ),
1446
+ geometry_tangent_bitangent_mapping,
1447
+ coat_normal
1448
+ ):
1449
+ coat_normal,
1450
+
1451
+ //Specular retro reflection
1452
+ //
1453
+ specular_retro_reflection_weight: tex::texture_isvalid(specular_retro_reflection_weight_image) ?
1454
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1455
+ ::OmniSurface::OmniImage::texture_lookup_2(
1456
+ specular_retro_reflection_weight_image,
1457
+ uvw_ignore_missing_textures,
1458
+ uvw_missing_texture_color,
1459
+ uvw_use_uv_coords,
1460
+ uvw_uv_coords,
1461
+ uvw_s_wrap,
1462
+ uvw_t_wrap,
1463
+ texture_coordinate_info
1464
+ ),
1465
+ specular_retro_reflection_weight_image_alpha_mode
1466
+ ).mono :
1467
+ specular_retro_reflection_weight,
1468
+
1469
+ specular_retro_reflection_color: tex::texture_isvalid(specular_retro_reflection_color_image) ?
1470
+ ::OmniSurface::OmniImage::texture_lookup_2(
1471
+ specular_retro_reflection_color_image,
1472
+ uvw_ignore_missing_textures,
1473
+ uvw_missing_texture_color,
1474
+ uvw_use_uv_coords,
1475
+ uvw_uv_coords,
1476
+ uvw_s_wrap,
1477
+ uvw_t_wrap,
1478
+ texture_coordinate_info
1479
+ ).tint :
1480
+ specular_retro_reflection_color,
1481
+
1482
+ specular_retro_reflection_roughness: tex::texture_isvalid(specular_retro_reflection_roughness_image) ?
1483
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1484
+ ::OmniSurface::OmniImage::texture_lookup_2(
1485
+ specular_retro_reflection_roughness_image,
1486
+ uvw_ignore_missing_textures,
1487
+ uvw_missing_texture_color,
1488
+ uvw_use_uv_coords,
1489
+ uvw_uv_coords,
1490
+ uvw_s_wrap,
1491
+ uvw_t_wrap,
1492
+ texture_coordinate_info
1493
+ ),
1494
+ specular_retro_reflection_roughness_image_alpha_mode
1495
+ ).mono :
1496
+ specular_retro_reflection_roughness,
1497
+
1498
+ //Emission
1499
+ //
1500
+ emission_weight: tex::texture_isvalid(emission_weight_image) ?
1501
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1502
+ ::OmniSurface::OmniImage::texture_lookup_2(
1503
+ emission_weight_image,
1504
+ uvw_ignore_missing_textures,
1505
+ uvw_missing_texture_color,
1506
+ uvw_use_uv_coords,
1507
+ uvw_uv_coords,
1508
+ uvw_s_wrap,
1509
+ uvw_t_wrap,
1510
+ texture_coordinate_info
1511
+ ),
1512
+ emission_weight_image_alpha_mode
1513
+ ).mono :
1514
+ emission_weight,
1515
+
1516
+ emission_mode: emission_mode,
1517
+
1518
+ emission_intensity: tex::texture_isvalid(emission_intensity_image) ?
1519
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1520
+ ::OmniSurface::OmniImage::texture_lookup_2(
1521
+ emission_intensity_image,
1522
+ uvw_ignore_missing_textures,
1523
+ uvw_missing_texture_color,
1524
+ uvw_use_uv_coords,
1525
+ uvw_uv_coords,
1526
+ uvw_s_wrap,
1527
+ uvw_t_wrap,
1528
+ texture_coordinate_info
1529
+ ),
1530
+ emission_intensity_image_alpha_mode
1531
+ ).mono :
1532
+ emission_intensity,
1533
+
1534
+ emission_color: tex::texture_isvalid(emission_color_image) ?
1535
+ ::OmniSurface::OmniImage::texture_lookup_2(
1536
+ emission_color_image,
1537
+ uvw_ignore_missing_textures,
1538
+ uvw_missing_texture_color,
1539
+ uvw_use_uv_coords,
1540
+ uvw_uv_coords,
1541
+ uvw_s_wrap,
1542
+ uvw_t_wrap,
1543
+ texture_coordinate_info
1544
+ ).tint :
1545
+ emission_color,
1546
+
1547
+ emission_use_temperature: emission_use_temperature,
1548
+
1549
+ emission_temperature: tex::texture_isvalid(emission_temperature_image) ?
1550
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1551
+ ::OmniSurface::OmniImage::texture_lookup_2(
1552
+ emission_temperature_image,
1553
+ uvw_ignore_missing_textures,
1554
+ uvw_missing_texture_color,
1555
+ uvw_use_uv_coords,
1556
+ uvw_uv_coords,
1557
+ uvw_s_wrap,
1558
+ uvw_t_wrap,
1559
+ texture_coordinate_info
1560
+ ),
1561
+ emission_temperature_image_alpha_mode
1562
+ ).mono :
1563
+ emission_temperature,
1564
+
1565
+ //Thin Film
1566
+ //
1567
+ enable_thin_film: enable_thin_film,
1568
+
1569
+ thin_film_thickness: tex::texture_isvalid(thin_film_thickness_image) ?
1570
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1571
+ ::OmniSurface::OmniImage::texture_lookup_2(
1572
+ thin_film_thickness_image,
1573
+ uvw_ignore_missing_textures,
1574
+ uvw_missing_texture_color,
1575
+ uvw_use_uv_coords,
1576
+ uvw_uv_coords,
1577
+ uvw_s_wrap,
1578
+ uvw_t_wrap,
1579
+ texture_coordinate_info
1580
+ ),
1581
+ thin_film_thickness_image_alpha_mode
1582
+ ).mono :
1583
+ thin_film_thickness,
1584
+
1585
+ thin_film_ior_preset: thin_film_ior_preset,
1586
+ thin_film_ior: thin_film_ior,
1587
+
1588
+ //Geometry
1589
+ //
1590
+ thin_walled: thin_walled,
1591
+
1592
+ enable_opacity: enable_opacity,
1593
+
1594
+ geometry_opacity: tex::texture_isvalid(geometry_opacity_image) ?
1595
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1596
+ ::OmniSurface::OmniImage::texture_lookup_2(
1597
+ geometry_opacity_image,
1598
+ uvw_ignore_missing_textures,
1599
+ uvw_missing_texture_color,
1600
+ uvw_use_uv_coords,
1601
+ uvw_uv_coords,
1602
+ uvw_s_wrap,
1603
+ uvw_t_wrap,
1604
+ texture_coordinate_info
1605
+ ),
1606
+ geometry_opacity_image_alpha_mode
1607
+ ).mono :
1608
+ geometry_opacity,
1609
+
1610
+ geometry_opacity_threshold: geometry_opacity_threshold,
1611
+
1612
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
1613
+
1614
+ geometry_normal_roughness: geometry_normal_roughness_data.roughness,
1615
+
1616
+ geometry_normal: ::OmniSurface::OmniImage::normal_mapping(
1617
+ geometry_normal_roughness_data.normal,
1618
+ geometry_tangent_bitangent_mapping,
1619
+ geometry_normal),
1620
+
1621
+ geometry_displacement: tex::texture_isvalid(geometry_displacement_image) ?
1622
+ ::OmniSurface::OmniShared::displacement_adjustment(
1623
+ (geometry_displacement_mode == ::OmniSurface::OmniShared::displacement_height) ?
1624
+ float3(::OmniSurface::OmniImage::texture_adjustment_2(
1625
+ OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1626
+ ::OmniSurface::OmniImage::texture_lookup_2(
1627
+ geometry_displacement_image,
1628
+ uvw_ignore_missing_textures,
1629
+ uvw_missing_texture_color,
1630
+ uvw_use_uv_coords,
1631
+ uvw_uv_coords,
1632
+ uvw_s_wrap,
1633
+ uvw_t_wrap,
1634
+ texture_coordinate_info
1635
+ ),
1636
+ geometry_displacement_image_alpha_mode
1637
+ ),
1638
+ 0.0f, //exposure
1639
+ color(0.5), //default_color
1640
+ color(1.0), //color_gain
1641
+ color(0.0), //color_offset
1642
+ 1.0f, //alpha_gain
1643
+ -1.0f * geometry_displacement_scalar_zero_value, //alpha_offset
1644
+ false, //invert
1645
+ 0.0f //blend_factor
1646
+ ).mono) :
1647
+
1648
+ float3(::OmniSurface::OmniImage::texture_lookup_2(
1649
+ geometry_displacement_image,
1650
+ uvw_ignore_missing_textures,
1651
+ uvw_missing_texture_color,
1652
+ uvw_use_uv_coords,
1653
+ uvw_uv_coords,
1654
+ uvw_s_wrap,
1655
+ uvw_t_wrap,
1656
+ texture_coordinate_info
1657
+ ).tint
1658
+ ),
1659
+
1660
+ geometry_displacement_mode,
1661
+
1662
+ tex::texture_isvalid(geometry_displacement_scale_image) ?
1663
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1664
+ ::OmniSurface::OmniImage::texture_lookup_2(
1665
+ geometry_displacement_scale_image,
1666
+ uvw_ignore_missing_textures,
1667
+ uvw_missing_texture_color,
1668
+ uvw_use_uv_coords,
1669
+ uvw_uv_coords,
1670
+ uvw_s_wrap,
1671
+ uvw_t_wrap,
1672
+ texture_coordinate_info
1673
+ ),
1674
+ geometry_displacement_scale_image_alpha_mode
1675
+ ).mono :
1676
+ geometry_displacement_scale
1677
+ ):
1678
+ geometry_displacement
1679
+ );
1680
+
1681
+ } in material(
1682
+ thin_walled: base.thin_walled,
1683
+ ior: base.ior,
1684
+ surface: base.surface,
1685
+ backface: base.backface,
1686
+ volume: base.volume,
1687
+ geometry: base.geometry
1688
+ );
saved/assets/_dependencies/public_validation/materials/OmniSurfaceLite.mdl ADDED
@@ -0,0 +1,1187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ // Wrapper for OmniSurfaceLiteBase material
30
+
31
+ mdl 1.7;
32
+
33
+ import ::anno::*;
34
+ import ::base::*;
35
+ import ::limits::*;
36
+ import ::state::*;
37
+ import ::tex::*;
38
+
39
+ import ::OmniSurface::OmniSurfaceLiteBase::*;
40
+ import ::OmniSurface::OmniShared::*;
41
+ import ::OmniSurface::OmniImage::*;
42
+
43
+ export material OmniSurfaceLite(
44
+
45
+ //Diffuse reflection
46
+ //
47
+ float diffuse_reflection_weight = float(0.8) [[
48
+ anno::display_name("Weight"),
49
+ anno::in_group("Base"),
50
+ anno::hard_range(0.0f, 1.0f)
51
+ ]],
52
+
53
+ uniform texture_2d diffuse_reflection_weight_image = texture_2d() [[
54
+ anno::display_name("Weight Image"),
55
+ anno::in_group("Base"),
56
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
57
+ ]],
58
+
59
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_weight_image_alpha_mode =
60
+ ::OmniSurface::OmniImage::alpha_default [[
61
+ anno::display_name("Weight Image Alpha Mode"),
62
+ anno::in_group("Base")
63
+ ]],
64
+
65
+ color diffuse_reflection_color = color(1.0) [[
66
+ anno::display_name("Color"),
67
+ anno::in_group("Base")
68
+ ]],
69
+
70
+ uniform texture_2d diffuse_reflection_color_image = texture_2d() [[
71
+ anno::display_name("Color Image"),
72
+ anno::in_group("Base")
73
+ ]],
74
+
75
+ float diffuse_reflection_roughness = float(0.0) [[
76
+ anno::display_name("Diffuse Roughness"),
77
+ anno::in_group("Base"),
78
+ anno::hard_range(0.0f, 1.0f)
79
+ ]],
80
+
81
+ uniform texture_2d diffuse_reflection_roughness_image = texture_2d() [[
82
+ anno::display_name("Diffuse Roughness Image"),
83
+ anno::in_group("Base"),
84
+ anno::usage("roughness")
85
+ ]],
86
+
87
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_roughness_image_alpha_mode =
88
+ ::OmniSurface::OmniImage::alpha_default [[
89
+ anno::display_name("Diffuse Roughness Alpha Mode"),
90
+ anno::in_group("Base")
91
+ ]],
92
+
93
+ //Metal
94
+ //
95
+ float metalness = float(0.0) [[
96
+ anno::display_name("Metalness"),
97
+ anno::in_group("Base"),
98
+ anno::hard_range(0.0f, 1.0f)
99
+ ]],
100
+
101
+ uniform texture_2d metalness_image = texture_2d() [[
102
+ anno::display_name("Metalness Image"),
103
+ anno::in_group("Base"),
104
+ anno::usage("metalness")
105
+ ]],
106
+
107
+ uniform ::OmniSurface::OmniImage::alpha_mode metalness_image_alpha_mode =
108
+ ::OmniSurface::OmniImage::alpha_default [[
109
+ anno::display_name("Metalness Image Alpha Mode"),
110
+ anno::in_group("Base")
111
+ ]],
112
+
113
+ //Specular reflection
114
+ //
115
+ float specular_reflection_weight = float(1.0) [[
116
+ anno::display_name("Weight"),
117
+ anno::in_group("Specular"),
118
+ anno::hard_range(0.0f, 1.0f)
119
+ ]],
120
+
121
+ uniform texture_2d specular_reflection_weight_image = texture_2d() [[
122
+ anno::display_name("Weight Image"),
123
+ anno::in_group("Specular"),
124
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
125
+ ]],
126
+
127
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_weight_image_alpha_mode =
128
+ ::OmniSurface::OmniImage::alpha_default [[
129
+ anno::display_name("Weight Image Alpha Mode"),
130
+ anno::in_group("Specular")
131
+ ]],
132
+
133
+ color specular_reflection_color = color(1.0) [[
134
+ anno::display_name("Color"),
135
+ anno::in_group("Specular")
136
+ ]],
137
+
138
+ uniform texture_2d specular_reflection_color_image = texture_2d() [[
139
+ anno::display_name("Color Image"),
140
+ anno::in_group("Specular")
141
+ ]],
142
+
143
+ float specular_reflection_roughness = float(0.2) [[
144
+ anno::display_name("Roughness"),
145
+ anno::in_group("Specular"),
146
+ anno::hard_range(0.0f, 1.0f)
147
+ ]],
148
+
149
+ uniform texture_2d specular_reflection_roughness_image = texture_2d() [[
150
+ anno::display_name("Roughness Image"),
151
+ anno::in_group("Specular"),
152
+ anno::usage("roughness")
153
+ ]],
154
+
155
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_roughness_image_alpha_mode =
156
+ ::OmniSurface::OmniImage::alpha_default [[
157
+ anno::display_name("Roughness Image Alpha Mode"),
158
+ anno::in_group("Specular")
159
+ ]],
160
+
161
+ uniform ::OmniSurface::OmniShared::ior_presets specular_reflection_ior_preset =
162
+ ::OmniSurface::OmniShared::ior_custom [[
163
+ anno::display_name("IOR Preset"),
164
+ anno::in_group("Specular")
165
+ ]],
166
+
167
+ uniform float specular_reflection_ior = float(1.5) [[
168
+ anno::display_name("IOR"),
169
+ anno::in_group("Specular"),
170
+ anno::soft_range(1.0f, 5.0f),
171
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
172
+ ]],
173
+
174
+ float specular_reflection_anisotropy = float(0.0) [[
175
+ anno::display_name("Anisotropy"),
176
+ anno::in_group("Specular"),
177
+ anno::hard_range(0.0f, 1.0f)
178
+ ]],
179
+
180
+ uniform texture_2d specular_reflection_anisotropy_image = texture_2d() [[
181
+ anno::display_name("Anisotropy Image"),
182
+ anno::in_group("Specular"),
183
+ anno::usage("aniotropy")
184
+ ]],
185
+
186
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_image_alpha_mode =
187
+ ::OmniSurface::OmniImage::alpha_default [[
188
+ anno::display_name("Anisotropy Image Alpha Mode"),
189
+ anno::in_group("Specular")
190
+ ]],
191
+
192
+ float specular_reflection_anisotropy_rotation = float(0.0) [[
193
+ anno::display_name("Rotation (radian)"),
194
+ anno::in_group("Specular"),
195
+ anno::soft_range(0.0f, 1.0f)
196
+ ]],
197
+
198
+ uniform texture_2d specular_reflection_anisotropy_rotation_image = texture_2d() [[
199
+ anno::display_name("Anisotropy Rotation Image"),
200
+ anno::in_group("Specular"),
201
+ anno::usage("anisotropy_rotation")
202
+ ]],
203
+
204
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_rotation_image_alpha_mode =
205
+ ::OmniSurface::OmniImage::alpha_default [[
206
+ anno::display_name("Anisotropy Rotation Alpha Mode"),
207
+ anno::in_group("Specular")
208
+ ]],
209
+
210
+ //Coat
211
+ //
212
+ float coat_weight = float(0.0) [[
213
+ anno::display_name("Weight"),
214
+ anno::in_group("Coat"),
215
+ anno::hard_range(0.0f, 1.0f)
216
+ ]],
217
+
218
+ uniform texture_2d coat_weight_image = texture_2d() [[
219
+ anno::display_name("Weight Image"),
220
+ anno::in_group("Coat"),
221
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
222
+ ]],
223
+
224
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_weight_image_alpha_mode =
225
+ ::OmniSurface::OmniImage::alpha_default [[
226
+ anno::display_name("Weight Image Alpha Mode"),
227
+ anno::in_group("Coat")
228
+ ]],
229
+
230
+ color coat_color = color(1.0) [[
231
+ anno::display_name("Color"),
232
+ anno::in_group("Coat")
233
+ ]],
234
+
235
+ uniform texture_2d coat_color_image = texture_2d() [[
236
+ anno::display_name("Color Image"),
237
+ anno::in_group("Coat")
238
+ ]],
239
+
240
+ float coat_roughness = float(0.1) [[
241
+ anno::display_name("Roughness"),
242
+ anno::in_group("Coat"),
243
+ anno::hard_range(0.0f, 1.0f)
244
+ ]],
245
+
246
+ uniform texture_2d coat_roughness_image = texture_2d() [[
247
+ anno::display_name("Roughness Image"),
248
+ anno::in_group("Coat"),
249
+ anno::usage("roughness")
250
+ ]],
251
+
252
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_roughness_image_alpha_mode =
253
+ ::OmniSurface::OmniImage::alpha_default [[
254
+ anno::display_name("Roughness Image Alpha Mode"),
255
+ anno::in_group("Coat")
256
+ ]],
257
+
258
+ uniform ::OmniSurface::OmniShared::ior_presets coat_ior_preset =
259
+ ::OmniSurface::OmniShared::ior_custom [[
260
+ anno::display_name("IOR Preset"),
261
+ anno::in_group("Coat")
262
+ ]],
263
+
264
+ uniform float coat_ior = float(1.5) [[
265
+ anno::display_name("IOR"),
266
+ anno::in_group("Coat"),
267
+ anno::soft_range(1.0f, 5.0f),
268
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
269
+ ]],
270
+
271
+ float coat_anisotropy = float(0.0) [[
272
+ anno::display_name("Anisotropy"),
273
+ anno::in_group("Coat"),
274
+ anno::hard_range(0.0f, 1.0f)
275
+ ]],
276
+
277
+ uniform texture_2d coat_anisotropy_image = texture_2d() [[
278
+ anno::display_name("Anisotropy Image"),
279
+ anno::in_group("Coat"),
280
+ anno::usage("anisotropy")
281
+ ]],
282
+
283
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_image_alpha_mode =
284
+ ::OmniSurface::OmniImage::alpha_default [[
285
+ anno::display_name("Anisotropy Image Alpha Mode"),
286
+ anno::in_group("Coat")
287
+ ]],
288
+
289
+ float coat_anisotropy_rotation = float(0.0) [[
290
+ anno::display_name("Rotation (radian)"),
291
+ anno::in_group("Coat"),
292
+ anno::soft_range(0.0f, 1.0f)
293
+ ]],
294
+
295
+ uniform texture_2d coat_anisotropy_rotation_image = texture_2d() [[
296
+ anno::display_name("Anisotropy Rotation Image"),
297
+ anno::in_group("Coat"),
298
+ anno::usage("anistropy_rotation")
299
+ ]],
300
+
301
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_rotation_image_alpha_mode =
302
+ ::OmniSurface::OmniImage::alpha_default [[
303
+ anno::display_name("Anisotropy Rotation Image Alpha Mode"),
304
+ anno::in_group("Coat")
305
+ ]],
306
+
307
+ float coat_affect_color = float(0.0) [[
308
+ anno::display_name("Affect Color"),
309
+ anno::in_group("Coat"),
310
+ anno::hard_range(0.0f, 1.0f)
311
+ ]],
312
+
313
+ uniform texture_2d coat_affect_color_image = texture_2d() [[
314
+ anno::display_name("Affect Color Image"),
315
+ anno::in_group("Coat"),
316
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
317
+ ]],
318
+
319
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_color_image_alpha_mode =
320
+ ::OmniSurface::OmniImage::alpha_default [[
321
+ anno::display_name("Affect Color Image Alpha Mode"),
322
+ anno::in_group("Coat")
323
+ ]],
324
+
325
+ float coat_affect_roughness = float(0.0) [[
326
+ anno::display_name("Affect Roughness"),
327
+ anno::in_group("Coat"),
328
+ anno::hard_range(0.0f, 1.0f)
329
+ ]],
330
+
331
+ uniform texture_2d coat_affect_roughness_image = texture_2d() [[
332
+ anno::display_name("Affect Roughness Image"),
333
+ anno::in_group("Coat"),
334
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
335
+ ]],
336
+
337
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_roughness_image_alpha_mode =
338
+ ::OmniSurface::OmniImage::alpha_default [[
339
+ anno::display_name("Affect Roughness Alpha Mode"),
340
+ anno::in_group("Coat")
341
+ ]],
342
+
343
+ uniform float coat_normal_strength = float(1.0) [[
344
+ anno::display_name("Normal Strength"),
345
+ anno::in_group("Coat"),
346
+ anno::soft_range(0.0f, 1.0f),
347
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
348
+ ]],
349
+
350
+ float3 coat_normal = state::normal() [[
351
+ anno::display_name("Normal"),
352
+ anno::in_group("Coat"),
353
+ anno::usage("normal")
354
+ ]],
355
+
356
+ uniform texture_2d coat_normal_image = texture_2d() [[
357
+ anno::display_name("Normal Map Image"),
358
+ anno::in_group("Coat"),
359
+ anno::usage("normal")
360
+ ]],
361
+
362
+ uniform bool coat_normal_image_flip_r_channel = false [[
363
+ anno::display_name("Normal Map Flip R Channel"),
364
+ anno::in_group("Coat")
365
+ ]],
366
+
367
+ uniform bool coat_normal_image_flip_g_channel = false [[
368
+ anno::display_name("Normal Map Flip G Channel"),
369
+ anno::in_group("Coat")
370
+ ]],
371
+
372
+ uniform bool coat_normal_image_flip_b_channel = false [[
373
+ anno::display_name("Normal Map Flip B Channel"),
374
+ anno::in_group("Coat")
375
+ ]],
376
+
377
+ //Emission
378
+ //
379
+ float emission_weight = float(0.0) [[
380
+ anno::display_name("Weight"),
381
+ anno::in_group("Emission"),
382
+ anno::hard_range(0.0f, 1.0f)
383
+ ]],
384
+
385
+ uniform texture_2d emission_weight_image = texture_2d() [[
386
+ anno::display_name("Weight Image"),
387
+ anno::in_group("Emission"),
388
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
389
+ ]],
390
+
391
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_weight_image_alpha_mode =
392
+ ::OmniSurface::OmniImage::alpha_default [[
393
+ anno::display_name("Weight Image Alpha Mode"),
394
+ anno::in_group("Emission")
395
+ ]],
396
+
397
+ uniform ::OmniSurface::OmniShared::emission_mode emission_mode =
398
+ ::OmniSurface::OmniShared::emission_lx
399
+ [[
400
+ anno::display_name("Emission Mode"),
401
+ anno::in_group("Emission")
402
+ ]],
403
+
404
+ float emission_intensity = float(1.0) [[
405
+ anno::display_name("Intensity"),
406
+ anno::in_group("Emission"),
407
+ anno::soft_range(0.0f, 1000.0f)
408
+ ]],
409
+
410
+ uniform texture_2d emission_intensity_image = texture_2d() [[
411
+ anno::display_name("Intensity Image"),
412
+ anno::in_group("Emission"),
413
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
414
+ ]],
415
+
416
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_intensity_image_alpha_mode =
417
+ ::OmniSurface::OmniImage::alpha_default [[
418
+ anno::display_name("Intensity Image Alpha Mode"),
419
+ anno::in_group("Emission")
420
+ ]],
421
+
422
+ color emission_color = color(1.0) [[
423
+ anno::display_name("Color"),
424
+ anno::in_group("Emission")
425
+ ]],
426
+
427
+ uniform texture_2d emission_color_image = texture_2d() [[
428
+ anno::display_name("Color Image"),
429
+ anno::in_group("Emission")
430
+ ]],
431
+
432
+ uniform bool emission_use_temperature = false [[
433
+ anno::display_name("Use Temperature"),
434
+ anno::in_group("Emission")
435
+ ]],
436
+
437
+ float emission_temperature = float(6500.0) [[
438
+ anno::display_name("Temperature (kelvin)"),
439
+ anno::in_group("Emission"),
440
+ anno::soft_range(0.0f, 10000.0f)
441
+ ]],
442
+
443
+ uniform texture_2d emission_temperature_image = texture_2d() [[
444
+ anno::display_name("Temperature Image"),
445
+ anno::in_group("Emission"),
446
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
447
+ ]],
448
+
449
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_temperature_image_alpha_mode =
450
+ ::OmniSurface::OmniImage::alpha_default [[
451
+ anno::display_name("Temperature Image Alpha Mode"),
452
+ anno::in_group("Emission")
453
+ ]],
454
+
455
+ //Geometry
456
+ //
457
+ uniform bool enable_opacity = false [[
458
+ anno::display_name("Enable Opacity"),
459
+ anno::description("Enables the use of cutout opacity"),
460
+ anno::in_group("Geometry")
461
+ ]],
462
+
463
+ float geometry_opacity = float(1.0) [[
464
+ anno::display_name("Opacity"),
465
+ anno::in_group("Geometry"),
466
+ anno::hard_range(0.0f, 1.0f)
467
+ ]],
468
+
469
+ uniform texture_2d geometry_opacity_image = texture_2d() [[
470
+ anno::display_name("Opacity Image"),
471
+ anno::in_group("Geometry"),
472
+ anno::usage("opacity")
473
+ ]],
474
+
475
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_opacity_image_alpha_mode =
476
+ ::OmniSurface::OmniImage::alpha_default [[
477
+ anno::display_name("Opacity Image Alpha Mode"),
478
+ anno::in_group("Geometry")
479
+ ]],
480
+
481
+ uniform float geometry_opacity_threshold = float(0.0) [[
482
+ anno::display_name("Opacity Threshold"),
483
+ anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
484
+ anno::in_group("Geometry"),
485
+ anno::hard_range(0.0f, 1.0f)
486
+ ]],
487
+
488
+ uniform float geometry_normal_strength = float(1.0) [[
489
+ anno::display_name("Geometry Normal Strength"),
490
+ anno::in_group("Geometry"),
491
+ anno::soft_range(0.0f, 1.0f),
492
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
493
+ ]],
494
+
495
+ uniform float geometry_normal_roughness_strength = float(1.0) [[
496
+ anno::display_name("Geometry Normal Roughness Strength"),
497
+ anno::in_group("Geometry"),
498
+ anno::hard_range(0.0f, 1.0f)
499
+ ]],
500
+
501
+ float3 geometry_normal = state::normal() [[
502
+ anno::display_name("Geometry Normal"),
503
+ anno::in_group("Geometry"),
504
+ anno::usage("normal")
505
+ ]],
506
+
507
+ uniform texture_2d geometry_normal_image = texture_2d() [[
508
+ anno::display_name("Geometry Normal Map Image"),
509
+ anno::in_group("Geometry"),
510
+ anno::usage("normal")
511
+ ]],
512
+
513
+ uniform bool geometry_normal_image_flip_r_channel = false [[
514
+ anno::display_name("Normal Map Flip R Channel"),
515
+ anno::in_group("Geometry")
516
+ ]],
517
+
518
+ uniform bool geometry_normal_image_flip_g_channel = false [[
519
+ anno::display_name("Normal Map Flip G Channel"),
520
+ anno::in_group("Geometry")
521
+ ]],
522
+
523
+ uniform bool geometry_normal_image_flip_b_channel = false [[
524
+ anno::display_name("Normal Map Flip B Channel"),
525
+ anno::in_group("Geometry")
526
+ ]],
527
+
528
+ uniform ::OmniSurface::OmniImage::tangent_bitangent_mapping geometry_tangent_bitangent_mapping =
529
+ ::OmniSurface::OmniImage::red_green [[
530
+ anno::display_name("Tangent Bitangent Mapping"),
531
+ anno::in_group("Geometry")
532
+ ]],
533
+
534
+ //Displacement
535
+ float3 geometry_displacement = float3(0.0) [[
536
+ anno::display_name("Displacement"),
537
+ anno::in_group("Geometry")
538
+ ]],
539
+
540
+ uniform ::OmniSurface::OmniShared::displacement_mode geometry_displacement_mode =
541
+ ::OmniSurface::OmniShared::displacement_height [[
542
+ anno::display_name("Displacement Mode"),
543
+ anno::in_group("Geometry")
544
+ ]],
545
+
546
+ uniform texture_2d geometry_displacement_image = texture_2d() [[
547
+ anno::display_name("Displacement Image"),
548
+ anno::in_group("Geometry"),
549
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
550
+ ]],
551
+
552
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_image_alpha_mode =
553
+ ::OmniSurface::OmniImage::alpha_default [[
554
+ anno::display_name("Displacement Image Alpha Mode"),
555
+ anno::in_group("Geometry")
556
+ ]],
557
+
558
+ float geometry_displacement_scale = float(1.0) [[
559
+ anno::display_name("Displacement Scale"),
560
+ anno::in_group("Geometry"),
561
+ anno::soft_range(0.0f, 1.0f)
562
+ ]],
563
+
564
+ uniform texture_2d geometry_displacement_scale_image = texture_2d() [[
565
+ anno::display_name("Displacement Scale Image"),
566
+ anno::in_group("Geometry"),
567
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
568
+ ]],
569
+
570
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_scale_image_alpha_mode =
571
+ ::OmniSurface::OmniImage::alpha_default [[
572
+ anno::display_name("Displacement Scale Image Alpha Mode"),
573
+ anno::in_group("Geometry")
574
+ ]],
575
+
576
+ float geometry_displacement_scalar_zero_value = float(0.0) [[
577
+ anno::display_name("Displacement Scalar Zero Value"),
578
+ anno::in_group("Geometry"),
579
+ anno::soft_range(0.0f, 1.0f)
580
+ ]],
581
+
582
+ //UVW
583
+ //
584
+ uniform base::texture_coordinate_system uvw_texture_coordinate_system =
585
+ base::texture_coordinate_uvw [[
586
+ anno::display_name("Texture Coordinate"),
587
+ anno::in_group("UVW Coordinates")
588
+ ]],
589
+
590
+ uniform int uvw_uv_set = 0 [[
591
+ anno::display_name("UV Set"),
592
+ anno::in_group("UVW Coordinates"),
593
+ anno::hard_range(0, 4)
594
+ ]],
595
+
596
+ uniform bool uvw_ignore_missing_textures = false [[
597
+ anno::display_name("Ignore Missing Images"),
598
+ anno::in_group("UVW Coordinates")
599
+ ]],
600
+
601
+ color uvw_missing_texture_color = color(0.0, 0.0, 0.0) [[
602
+ anno::display_name("Missing Image Color"),
603
+ anno::in_group("UVW Coordinates")
604
+ ]],
605
+
606
+ uniform bool uvw_use_uv_coords = false [[
607
+ anno::display_name("Use UV Coords"),
608
+ anno::in_group("UVW Coordinates")
609
+ ]],
610
+
611
+ float2 uvw_uv_coords = float2(0.0) [[
612
+ anno::display_name("UV Coords"),
613
+ anno::in_group("UVW Coordinates")
614
+ ]],
615
+
616
+ uniform float uvw_s_offset = 0.0f [[
617
+ anno::display_name("Offset U"),
618
+ anno::in_group("UVW Coordinates"),
619
+ anno::soft_range(-1.0f, 1.0f)
620
+ ]],
621
+
622
+ uniform float uvw_t_offset = 0.0f [[
623
+ anno::display_name("Offset V"),
624
+ anno::in_group("UVW Coordinates"),
625
+ anno::soft_range(-1.0f, 1.0f)
626
+ ]],
627
+
628
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_s_wrap =
629
+ ::OmniSurface::OmniImage::wrap_periodic [[
630
+ anno::display_name("Wrap U"),
631
+ anno::in_group("UVW Coordinates")
632
+ ]],
633
+
634
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_t_wrap =
635
+ ::OmniSurface::OmniImage::wrap_periodic [[
636
+ anno::display_name("Wrap V"),
637
+ anno::in_group("UVW Coordinates")
638
+ ]],
639
+
640
+ uniform float uvw_s_scale = 1.0f [[
641
+ anno::display_name("Scale U"),
642
+ anno::in_group("UVW Coordinates"),
643
+ anno::soft_range(0.0f, 100.0f)
644
+ ]],
645
+
646
+ uniform float uvw_t_scale = 1.0f [[
647
+ anno::display_name("Scale V"),
648
+ anno::in_group("UVW Coordinates"),
649
+ anno::soft_range(0.0f, 100.0f)
650
+ ]],
651
+
652
+ uniform bool uvw_s_flip = false [[
653
+ anno::display_name("Flip U"),
654
+ anno::in_group("UVW Coordinates")
655
+ ]],
656
+
657
+ uniform bool uvw_t_flip = false [[
658
+ anno::display_name("Flip V"),
659
+ anno::in_group("UVW Coordinates")
660
+ ]],
661
+
662
+ uniform bool uvw_swap_st = false [[
663
+ anno::display_name("Swap UV"),
664
+ anno::in_group("UVW Coordinates")
665
+ ]],
666
+
667
+ //Projection Coordinates (Local / World)
668
+ uniform ::OmniSurface::OmniImage::projection_mode uvw_projection_mode =
669
+ ::OmniSurface::OmniImage::projection_cubic [[
670
+ anno::display_name("Projection Mode"),
671
+ anno::in_group("UVW Coordinates")
672
+ ]],
673
+
674
+ uniform float3 uvw_projection_translate = float3(0.0) [[
675
+ anno::display_name("Translate"),
676
+ anno::description("Translate the projected texture."),
677
+ anno::in_group("UVW Coordinates")
678
+ ]],
679
+
680
+ uniform float3 uvw_projection_rotate = float3(0.0) [[
681
+ anno::display_name("Rotate"),
682
+ anno::description("Rotate the projected texture."),
683
+ anno::in_group("UVW Coordinates")
684
+ ]],
685
+
686
+ uniform float3 uvw_projection_scale = float3(1.0) [[
687
+ anno::display_name("Scale"),
688
+ anno::description("Scale the projected texture."),
689
+ anno::in_group("UVW Coordinates")
690
+ ]]
691
+ )
692
+ [[
693
+ anno::display_name("OmniSurfaceLite"),
694
+ anno::description("A base material for modeling a variety of surfaces."),
695
+ anno::author("NVIDIA Corporation"),
696
+ anno::key_words(string[]("generic", "surface")),
697
+ anno::version(1, 0, 0, ""),
698
+ anno::in_group("Advanced")
699
+ ]] = let {
700
+
701
+ base::texture_coordinate_info texture_coordinate_info =
702
+ ::OmniSurface::OmniImage::compute_texture_coordinate_2(
703
+ uvw_texture_coordinate_system,
704
+ uvw_uv_set,
705
+ uvw_s_offset,
706
+ uvw_t_offset,
707
+ uvw_s_scale,
708
+ uvw_t_scale,
709
+ uvw_s_flip,
710
+ uvw_t_flip,
711
+ uvw_swap_st,
712
+ uvw_projection_mode,
713
+ uvw_projection_translate,
714
+ uvw_projection_rotate,
715
+ uvw_projection_scale);
716
+
717
+ ::OmniSurface::OmniImage::normal_roughness_data geometry_normal_roughness_data =
718
+ tex::texture_isvalid(geometry_normal_image) ?
719
+ ::OmniSurface::OmniImage::tangent_space_normal_roughness_lookup_2(
720
+ geometry_normal_image,
721
+ uvw_ignore_missing_textures,
722
+ uvw_use_uv_coords,
723
+ uvw_uv_coords,
724
+ uvw_s_wrap,
725
+ uvw_t_wrap,
726
+ uvw_s_flip,
727
+ uvw_t_flip,
728
+ geometry_normal_strength,
729
+ geometry_normal_image_flip_r_channel,
730
+ geometry_normal_image_flip_g_channel,
731
+ geometry_normal_image_flip_b_channel,
732
+ texture_coordinate_info
733
+ ) :
734
+ ::OmniSurface::OmniImage::normal_roughness_data(geometry_normal, float2(0.0));
735
+
736
+ material base = ::OmniSurface::OmniSurfaceLiteBase::OmniSurfaceLiteBase (
737
+
738
+ //Base
739
+ //
740
+ diffuse_reflection_weight: tex::texture_isvalid(diffuse_reflection_weight_image) ?
741
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
742
+ ::OmniSurface::OmniImage::texture_lookup_2(
743
+ diffuse_reflection_weight_image,
744
+ uvw_ignore_missing_textures,
745
+ uvw_missing_texture_color,
746
+ uvw_use_uv_coords,
747
+ uvw_uv_coords,
748
+ uvw_s_wrap,
749
+ uvw_t_wrap,
750
+ texture_coordinate_info
751
+ ),
752
+ diffuse_reflection_weight_image_alpha_mode
753
+ ).mono :
754
+ diffuse_reflection_weight,
755
+
756
+ diffuse_reflection_color: tex::texture_isvalid(diffuse_reflection_color_image) ?
757
+ ::OmniSurface::OmniImage::texture_lookup_2(
758
+ diffuse_reflection_color_image,
759
+ uvw_ignore_missing_textures,
760
+ uvw_missing_texture_color,
761
+ uvw_use_uv_coords,
762
+ uvw_uv_coords,
763
+ uvw_s_wrap,
764
+ uvw_t_wrap,
765
+ texture_coordinate_info
766
+ ).tint :
767
+ diffuse_reflection_color,
768
+
769
+ diffuse_reflection_roughness: tex::texture_isvalid(diffuse_reflection_roughness_image) ?
770
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
771
+ ::OmniSurface::OmniImage::texture_lookup_2(
772
+ diffuse_reflection_roughness_image,
773
+ uvw_ignore_missing_textures,
774
+ uvw_missing_texture_color,
775
+ uvw_use_uv_coords,
776
+ uvw_uv_coords,
777
+ uvw_s_wrap,
778
+ uvw_t_wrap,
779
+ texture_coordinate_info
780
+ ),
781
+ diffuse_reflection_roughness_image_alpha_mode
782
+ ).mono :
783
+ diffuse_reflection_roughness,
784
+
785
+ //Metalness
786
+ //
787
+ metalness: tex::texture_isvalid(metalness_image) ?
788
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
789
+ ::OmniSurface::OmniImage::texture_lookup_2(
790
+ metalness_image,
791
+ uvw_ignore_missing_textures,
792
+ uvw_missing_texture_color,
793
+ uvw_use_uv_coords,
794
+ uvw_uv_coords,
795
+ uvw_s_wrap,
796
+ uvw_t_wrap,
797
+ texture_coordinate_info
798
+ ),
799
+ metalness_image_alpha_mode
800
+ ).mono :
801
+ metalness,
802
+
803
+ //Specular reflection
804
+ //
805
+ specular_reflection_weight: tex::texture_isvalid(specular_reflection_weight_image) ?
806
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
807
+ ::OmniSurface::OmniImage::texture_lookup_2(
808
+ specular_reflection_weight_image,
809
+ uvw_ignore_missing_textures,
810
+ uvw_missing_texture_color,
811
+ uvw_use_uv_coords,
812
+ uvw_uv_coords,
813
+ uvw_s_wrap,
814
+ uvw_t_wrap,
815
+ texture_coordinate_info
816
+ ),
817
+ specular_reflection_weight_image_alpha_mode
818
+ ).mono :
819
+ specular_reflection_weight,
820
+
821
+ specular_reflection_color: tex::texture_isvalid(specular_reflection_color_image) ?
822
+ ::OmniSurface::OmniImage::texture_lookup_2(
823
+ specular_reflection_color_image,
824
+ uvw_ignore_missing_textures,
825
+ uvw_missing_texture_color,
826
+ uvw_use_uv_coords,
827
+ uvw_uv_coords,
828
+ uvw_s_wrap,
829
+ uvw_t_wrap,
830
+ texture_coordinate_info
831
+ ).tint :
832
+ specular_reflection_color,
833
+
834
+ specular_reflection_roughness: tex::texture_isvalid(specular_reflection_roughness_image) ?
835
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
836
+ ::OmniSurface::OmniImage::texture_lookup_2(
837
+ specular_reflection_roughness_image,
838
+ uvw_ignore_missing_textures,
839
+ uvw_missing_texture_color,
840
+ uvw_use_uv_coords,
841
+ uvw_uv_coords,
842
+ uvw_s_wrap,
843
+ uvw_t_wrap,
844
+ texture_coordinate_info
845
+ ),
846
+ specular_reflection_roughness_image_alpha_mode
847
+ ).mono :
848
+ specular_reflection_roughness,
849
+
850
+ specular_reflection_ior_preset: specular_reflection_ior_preset,
851
+ specular_reflection_ior: specular_reflection_ior,
852
+
853
+ specular_reflection_anisotropy: tex::texture_isvalid(specular_reflection_anisotropy_image) ?
854
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
855
+ ::OmniSurface::OmniImage::texture_lookup_2(
856
+ specular_reflection_anisotropy_image,
857
+ uvw_ignore_missing_textures,
858
+ uvw_missing_texture_color,
859
+ uvw_use_uv_coords,
860
+ uvw_uv_coords,
861
+ uvw_s_wrap,
862
+ uvw_t_wrap,
863
+ texture_coordinate_info
864
+ ),
865
+ specular_reflection_anisotropy_image_alpha_mode
866
+ ).mono :
867
+ specular_reflection_anisotropy,
868
+
869
+ specular_reflection_anisotropy_rotation: tex::texture_isvalid(
870
+ specular_reflection_anisotropy_rotation_image) ?
871
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
872
+ ::OmniSurface::OmniImage::texture_lookup_2(
873
+ specular_reflection_anisotropy_rotation_image,
874
+ uvw_ignore_missing_textures,
875
+ uvw_missing_texture_color,
876
+ uvw_use_uv_coords,
877
+ uvw_uv_coords,
878
+ uvw_s_wrap,
879
+ uvw_t_wrap,
880
+ texture_coordinate_info
881
+ ),
882
+ specular_reflection_anisotropy_rotation_image_alpha_mode
883
+ ).mono :
884
+ specular_reflection_anisotropy_rotation,
885
+
886
+ //Coat
887
+ //
888
+ coat_weight: tex::texture_isvalid(coat_weight_image) ?
889
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
890
+ ::OmniSurface::OmniImage::texture_lookup_2(
891
+ coat_weight_image,
892
+ uvw_ignore_missing_textures,
893
+ uvw_missing_texture_color,
894
+ uvw_use_uv_coords,
895
+ uvw_uv_coords,
896
+ uvw_s_wrap,
897
+ uvw_t_wrap,
898
+ texture_coordinate_info
899
+ ),
900
+ coat_weight_image_alpha_mode
901
+ ).mono :
902
+ coat_weight,
903
+
904
+ coat_color: tex::texture_isvalid(coat_color_image) ?
905
+ ::OmniSurface::OmniImage::texture_lookup_2(
906
+ coat_color_image,
907
+ uvw_ignore_missing_textures,
908
+ uvw_missing_texture_color,
909
+ uvw_use_uv_coords,
910
+ uvw_uv_coords,
911
+ uvw_s_wrap,
912
+ uvw_t_wrap,
913
+ texture_coordinate_info
914
+ ).tint :
915
+ coat_color,
916
+
917
+ coat_roughness: tex::texture_isvalid(coat_roughness_image) ?
918
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
919
+ ::OmniSurface::OmniImage::texture_lookup_2(
920
+ coat_roughness_image,
921
+ uvw_ignore_missing_textures,
922
+ uvw_missing_texture_color,
923
+ uvw_use_uv_coords,
924
+ uvw_uv_coords,
925
+ uvw_s_wrap,
926
+ uvw_t_wrap,
927
+ texture_coordinate_info
928
+ ),
929
+ coat_roughness_image_alpha_mode
930
+ ).mono :
931
+ coat_roughness,
932
+
933
+ coat_ior_preset: coat_ior_preset,
934
+ coat_ior: coat_ior,
935
+
936
+ coat_anisotropy: tex::texture_isvalid(coat_anisotropy_image) ?
937
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
938
+ ::OmniSurface::OmniImage::texture_lookup_2(
939
+ coat_anisotropy_image,
940
+ uvw_ignore_missing_textures,
941
+ uvw_missing_texture_color,
942
+ uvw_use_uv_coords,
943
+ uvw_uv_coords,
944
+ uvw_s_wrap,
945
+ uvw_t_wrap,
946
+ texture_coordinate_info
947
+ ),
948
+ coat_anisotropy_image_alpha_mode
949
+ ).mono :
950
+ coat_anisotropy,
951
+
952
+ coat_anisotropy_rotation: tex::texture_isvalid(coat_anisotropy_rotation_image) ?
953
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
954
+ ::OmniSurface::OmniImage::texture_lookup_2(
955
+ coat_anisotropy_rotation_image,
956
+ uvw_ignore_missing_textures,
957
+ uvw_missing_texture_color,
958
+ uvw_use_uv_coords,
959
+ uvw_uv_coords,
960
+ uvw_s_wrap,
961
+ uvw_t_wrap,
962
+ texture_coordinate_info
963
+ ),
964
+ coat_anisotropy_rotation_image_alpha_mode
965
+ ).mono :
966
+ coat_anisotropy_rotation,
967
+
968
+ coat_affect_color: tex::texture_isvalid(coat_affect_color_image) ?
969
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
970
+ ::OmniSurface::OmniImage::texture_lookup_2(
971
+ coat_affect_color_image,
972
+ uvw_ignore_missing_textures,
973
+ uvw_missing_texture_color,
974
+ uvw_use_uv_coords,
975
+ uvw_uv_coords,
976
+ uvw_s_wrap,
977
+ uvw_t_wrap,
978
+ texture_coordinate_info
979
+ ),
980
+ coat_affect_color_image_alpha_mode
981
+ ).mono :
982
+ coat_affect_color,
983
+
984
+ coat_affect_roughness: tex::texture_isvalid(coat_affect_roughness_image) ?
985
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
986
+ ::OmniSurface::OmniImage::texture_lookup_2(
987
+ coat_affect_roughness_image,
988
+ uvw_ignore_missing_textures,
989
+ uvw_missing_texture_color,
990
+ uvw_use_uv_coords,
991
+ uvw_uv_coords,
992
+ uvw_s_wrap,
993
+ uvw_t_wrap,
994
+ texture_coordinate_info
995
+ ),
996
+ coat_affect_roughness_image_alpha_mode
997
+ ).mono :
998
+ coat_affect_roughness,
999
+
1000
+ coat_normal: tex::texture_isvalid(coat_normal_image) ?
1001
+ ::OmniSurface::OmniImage::normal_mapping(
1002
+ ::OmniSurface::OmniImage::tangent_space_normal_lookup_2(
1003
+ coat_normal_image,
1004
+ uvw_ignore_missing_textures,
1005
+ uvw_use_uv_coords,
1006
+ uvw_uv_coords,
1007
+ uvw_s_wrap,
1008
+ uvw_t_wrap,
1009
+ uvw_s_flip,
1010
+ uvw_t_flip,
1011
+ coat_normal_strength,
1012
+ coat_normal_image_flip_r_channel,
1013
+ coat_normal_image_flip_g_channel,
1014
+ coat_normal_image_flip_b_channel,
1015
+ texture_coordinate_info
1016
+ ),
1017
+ geometry_tangent_bitangent_mapping,
1018
+ coat_normal
1019
+ ):
1020
+ coat_normal,
1021
+
1022
+ //Emission
1023
+ //
1024
+ emission_weight: tex::texture_isvalid(emission_weight_image) ?
1025
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1026
+ ::OmniSurface::OmniImage::texture_lookup_2(
1027
+ emission_weight_image,
1028
+ uvw_ignore_missing_textures,
1029
+ uvw_missing_texture_color,
1030
+ uvw_use_uv_coords,
1031
+ uvw_uv_coords,
1032
+ uvw_s_wrap,
1033
+ uvw_t_wrap,
1034
+ texture_coordinate_info
1035
+ ),
1036
+ emission_weight_image_alpha_mode
1037
+ ).mono :
1038
+ emission_weight,
1039
+
1040
+ emission_mode: emission_mode,
1041
+
1042
+ emission_intensity: tex::texture_isvalid(emission_intensity_image) ?
1043
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1044
+ ::OmniSurface::OmniImage::texture_lookup_2(
1045
+ emission_intensity_image,
1046
+ uvw_ignore_missing_textures,
1047
+ uvw_missing_texture_color,
1048
+ uvw_use_uv_coords,
1049
+ uvw_uv_coords,
1050
+ uvw_s_wrap,
1051
+ uvw_t_wrap,
1052
+ texture_coordinate_info
1053
+ ),
1054
+ emission_intensity_image_alpha_mode
1055
+ ).mono :
1056
+ emission_intensity,
1057
+
1058
+ emission_color: tex::texture_isvalid(emission_color_image) ?
1059
+ ::OmniSurface::OmniImage::texture_lookup_2(
1060
+ emission_color_image,
1061
+ uvw_ignore_missing_textures,
1062
+ uvw_missing_texture_color,
1063
+ uvw_use_uv_coords,
1064
+ uvw_uv_coords,
1065
+ uvw_s_wrap,
1066
+ uvw_t_wrap,
1067
+ texture_coordinate_info
1068
+ ).tint :
1069
+ emission_color,
1070
+
1071
+ emission_use_temperature: emission_use_temperature,
1072
+
1073
+ emission_temperature: tex::texture_isvalid(emission_temperature_image) ?
1074
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1075
+ ::OmniSurface::OmniImage::texture_lookup_2(
1076
+ emission_temperature_image,
1077
+ uvw_ignore_missing_textures,
1078
+ uvw_missing_texture_color,
1079
+ uvw_use_uv_coords,
1080
+ uvw_uv_coords,
1081
+ uvw_s_wrap,
1082
+ uvw_t_wrap,
1083
+ texture_coordinate_info
1084
+ ),
1085
+ emission_temperature_image_alpha_mode
1086
+ ).mono :
1087
+ emission_temperature,
1088
+
1089
+ //Geometry
1090
+ //
1091
+ enable_opacity: enable_opacity,
1092
+
1093
+ geometry_opacity: tex::texture_isvalid(geometry_opacity_image) ?
1094
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1095
+ ::OmniSurface::OmniImage::texture_lookup_2(
1096
+ geometry_opacity_image,
1097
+ uvw_ignore_missing_textures,
1098
+ uvw_missing_texture_color,
1099
+ uvw_use_uv_coords,
1100
+ uvw_uv_coords,
1101
+ uvw_s_wrap,
1102
+ uvw_t_wrap,
1103
+ texture_coordinate_info
1104
+ ),
1105
+ geometry_opacity_image_alpha_mode
1106
+ ).mono :
1107
+ geometry_opacity,
1108
+
1109
+ geometry_opacity_threshold: geometry_opacity_threshold,
1110
+
1111
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
1112
+
1113
+ geometry_normal_roughness: geometry_normal_roughness_data.roughness,
1114
+
1115
+ geometry_normal: ::OmniSurface::OmniImage::normal_mapping(
1116
+ geometry_normal_roughness_data.normal,
1117
+ geometry_tangent_bitangent_mapping,
1118
+ geometry_normal),
1119
+
1120
+ geometry_displacement: tex::texture_isvalid(geometry_displacement_image) ?
1121
+ ::OmniSurface::OmniShared::displacement_adjustment(
1122
+ (geometry_displacement_mode == ::OmniSurface::OmniShared::displacement_height) ?
1123
+ float3(::OmniSurface::OmniImage::texture_adjustment_2(
1124
+ OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1125
+ ::OmniSurface::OmniImage::texture_lookup_2(
1126
+ geometry_displacement_image,
1127
+ uvw_ignore_missing_textures,
1128
+ uvw_missing_texture_color,
1129
+ uvw_use_uv_coords,
1130
+ uvw_uv_coords,
1131
+ uvw_s_wrap,
1132
+ uvw_t_wrap,
1133
+ texture_coordinate_info
1134
+ ),
1135
+ geometry_displacement_image_alpha_mode
1136
+ ),
1137
+ 0.0f, //exposure
1138
+ color(0.5), //default_color
1139
+ color(1.0), //color_gain
1140
+ color(0.0), //color_offset
1141
+ 1.0f, //alpha_gain
1142
+ -1.0f * geometry_displacement_scalar_zero_value, //alpha_offset
1143
+ false, //invert
1144
+ 0.0f //blend_factor
1145
+ ).mono) :
1146
+
1147
+ float3(::OmniSurface::OmniImage::texture_lookup_2(
1148
+ geometry_displacement_image,
1149
+ uvw_ignore_missing_textures,
1150
+ uvw_missing_texture_color,
1151
+ uvw_use_uv_coords,
1152
+ uvw_uv_coords,
1153
+ uvw_s_wrap,
1154
+ uvw_t_wrap,
1155
+ texture_coordinate_info
1156
+ ).tint
1157
+ ),
1158
+
1159
+ geometry_displacement_mode,
1160
+
1161
+ tex::texture_isvalid(geometry_displacement_scale_image) ?
1162
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1163
+ ::OmniSurface::OmniImage::texture_lookup_2(
1164
+ geometry_displacement_scale_image,
1165
+ uvw_ignore_missing_textures,
1166
+ uvw_missing_texture_color,
1167
+ uvw_use_uv_coords,
1168
+ uvw_uv_coords,
1169
+ uvw_s_wrap,
1170
+ uvw_t_wrap,
1171
+ texture_coordinate_info
1172
+ ),
1173
+ geometry_displacement_scale_image_alpha_mode
1174
+ ).mono :
1175
+ geometry_displacement_scale
1176
+ ):
1177
+ geometry_displacement
1178
+ );
1179
+
1180
+ } in material(
1181
+ thin_walled: base.thin_walled,
1182
+ ior: base.ior,
1183
+ surface: base.surface,
1184
+ backface: base.backface,
1185
+ volume: base.volume,
1186
+ geometry: base.geometry
1187
+ );
saved/assets/_dependencies/public_validation/materials/OmniSurfacePresets.mdl ADDED
The diff for this file is too large to render. See raw diff
 
saved/assets/_dependencies/public_validation/materials/pbr.mdl ADDED
@@ -0,0 +1,910 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ *****************************************************************************/
28
+
29
+ mdl 1.8;
30
+
31
+ import ::anno::*;
32
+ import ::base::*;
33
+ import ::df::*;
34
+ import ::math::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::scene::*;
38
+ import ::limits::*;
39
+
40
+ export enum gltf_alpha_mode {
41
+ opaque,
42
+ mask,
43
+ blend
44
+ };
45
+
46
+ export enum gltf_wrapping_mode {
47
+ clamp_to_edge = 33071,
48
+ mirrored_repeat = 33648,
49
+ repeat = 10497
50
+ };
51
+
52
+ export struct gltf_texture_lookup_value
53
+ {
54
+ bool valid = false;
55
+ float4 value = float4(0.0, 0.0, 0.0, 1.0);
56
+ };
57
+
58
+ export struct gltf_normal_texture_lookup_value
59
+ {
60
+ bool valid = false;
61
+ float3 value = float3(0.0);
62
+ };
63
+
64
+ float compute_opacity(gltf_alpha_mode mode, float alpha, float cutoff) {
65
+ switch (mode) {
66
+ case mask:
67
+ return alpha < cutoff ? 0.0 : 1.0;
68
+ case blend:
69
+ return alpha;
70
+ case opaque:
71
+ return 1.0;
72
+ }
73
+ }
74
+
75
+ float4 gltf_prepare_tex_float4(gltf_texture_lookup_value sample) {
76
+ return sample.valid ? sample.value : float4(1.0);
77
+ }
78
+
79
+ float3 gltf_prepare_tex_float3(gltf_texture_lookup_value sample) {
80
+ return sample.valid ? float3(sample.value.x, sample.value.y, sample.value.z) : float3(1.0);
81
+ }
82
+
83
+ float3 gltf_prepare_normal(gltf_normal_texture_lookup_value sample) {
84
+ return sample.valid ? sample.value : state::normal();
85
+ }
86
+
87
+ float gltf_prepare_occlusion(gltf_texture_lookup_value sample, float occlusion_strength) {
88
+ float occulusion = sample.valid ? sample.value.x : 1.0;
89
+ return math::lerp(1.0, occulusion, occlusion_strength);
90
+ }
91
+
92
+ color gltf_perpare_emission(gltf_texture_lookup_value sample, color emissive_factor) {
93
+ return emissive_factor * color(gltf_prepare_tex_float3(sample));
94
+ }
95
+
96
+ ::tex::wrap_mode convert_wrap_mode(gltf_wrapping_mode mode)
97
+ {
98
+ if (mode == clamp_to_edge)
99
+ return ::tex::wrap_clamp;
100
+ if (mode == mirrored_repeat)
101
+ return ::tex::wrap_mirrored_repeat;
102
+
103
+ return ::tex::wrap_repeat;
104
+ }
105
+
106
+ float2 khr_texture_transform_apply(
107
+ float2 coord,
108
+ float2 offset,
109
+ float rotation,
110
+ float2 scale
111
+ )
112
+ {
113
+ // MDL expects the texture coordinate origin at the bottom left (gltf at top left)
114
+ // Assuming the renderer follows the MDL specification in which case the coordinates
115
+ // have been flipped either while loading the glTF geometry or while setting up the state.
116
+
117
+ // Undo the flipping for the transformation to get into the original glTF texture space.
118
+ coord = float2(coord.x, 1.0f - coord.y);
119
+
120
+ // first scale
121
+ coord = coord * scale;
122
+ // then rotate
123
+ float cos_rotation = ::math::cos(rotation);
124
+ float sin_rotation = ::math::sin(rotation);
125
+ coord = float2(cos_rotation * coord.x + sin_rotation * coord.y, cos_rotation * coord.y - sin_rotation * coord.x);
126
+ // then translate
127
+ coord = coord + offset;
128
+
129
+ // flip back
130
+ coord = float2(coord.x, 1.0f - coord.y);
131
+ return coord;
132
+ }
133
+
134
+ export gltf_texture_lookup_value gltf_texture_lookup(
135
+ uniform texture_2d texture = texture_2d()
136
+ [[
137
+ anno::in_group("Source"),
138
+ anno::display_name("Texture"),
139
+ anno::description("Texture File")
140
+ ]],
141
+ uniform int tex_coord_index = 0
142
+ [[
143
+ anno::in_group("Source"),
144
+ anno::display_name("Coordinate Set"),
145
+ anno::description("Texture coordinate set (UV-Set). KHR_texture_transform overrides the textureInfo texCoord value if supplied."),
146
+ anno::enable_if("::tex::texture_isvalid(texture)")
147
+ ]],
148
+
149
+ uniform float2 offset = float2(0.0f, 0.0)
150
+ [[
151
+ anno::in_group("Texture Transform"),
152
+ anno::display_name("Offset"),
153
+ anno::description("The offset of the UV coordinate origin as a factor of the texture dimensions."),
154
+ anno::enable_if("::tex::texture_isvalid(texture)")
155
+ ]],
156
+ uniform float rotation = 0.0
157
+ [[
158
+ anno::hard_range(0.0, 2.0 * ::math::PI),
159
+ anno::in_group("Texture Transform"),
160
+ anno::display_name("Rotation"),
161
+ anno::description("Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise."),
162
+ anno::enable_if("::tex::texture_isvalid(texture)")
163
+ ]],
164
+ uniform float2 scale = float2(1.0f, 1.0f)
165
+ [[
166
+ anno::in_group("Texture Transform"),
167
+ anno::display_name("Scale"),
168
+ anno::description("The scale factor applied to the components of the UV coordinates."),
169
+ anno::enable_if("::tex::texture_isvalid(texture)")
170
+ ]],
171
+
172
+ uniform gltf_wrapping_mode wrap_s = repeat
173
+ [[
174
+ anno::in_group("Sampler"),
175
+ anno::display_name("Wrap S"),
176
+ anno::description("S (U) wrapping mode."),
177
+ anno::enable_if("::tex::texture_isvalid(texture)")
178
+ ]],
179
+ uniform gltf_wrapping_mode wrap_t = repeat
180
+ [[
181
+ anno::in_group("Sampler"),
182
+ anno::display_name("Wrap T"),
183
+ anno::description("T (V) wrapping mode."),
184
+ anno::enable_if("::tex::texture_isvalid(texture)")
185
+ ]]
186
+ )
187
+ [[
188
+ anno::author("NVIDIA Corporation"),
189
+ anno::display_name("GLTF Texture Lookup"),
190
+ anno::description("Function to read a color or color with alpha channel texture.")
191
+ ]]
192
+ {
193
+ gltf_texture_lookup_value tex_ret;
194
+ if (!tex::texture_isvalid(texture))
195
+ return tex_ret;
196
+
197
+ float3 tex_coord3 = state::texture_coordinate(tex_coord_index);
198
+ float2 tex_coord = khr_texture_transform_apply(
199
+ coord: float2(tex_coord3.x, tex_coord3.y),
200
+ offset: offset,
201
+ rotation: rotation,
202
+ scale: scale);
203
+
204
+ tex_ret.value = tex::lookup_float4(
205
+ tex: texture,
206
+ coord: tex_coord,
207
+ wrap_u: convert_wrap_mode(wrap_s),
208
+ wrap_v: convert_wrap_mode(wrap_t));
209
+ tex_ret.valid = true;
210
+ return tex_ret;
211
+ }
212
+
213
+ export gltf_normal_texture_lookup_value gltf_normal_texture_lookup(
214
+ uniform texture_2d texture = texture_2d()
215
+ [[
216
+ anno::in_group("Source"),
217
+ anno::display_name("Texture"),
218
+ anno::description("Texture File")
219
+ ]],
220
+ uniform float normal_scale_factor = 1.0
221
+ [[
222
+ anno::hard_range(0.0, 1.0),
223
+ anno::in_group("Source"),
224
+ anno::display_name("Normal Scale Factor"),
225
+ anno::description("Strength of the base layer normal mapping."),
226
+ anno::enable_if("::tex::texture_isvalid(texture)")
227
+ ]],
228
+ uniform int tex_coord_index = 0
229
+ [[
230
+ anno::in_group("Source"),
231
+ anno::display_name("Coordinate Set"),
232
+ anno::description("Texture coordinate set (UV-Set). KHR_texture_transform overrides the textureInfo texCoord value if supplied."),
233
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
234
+ ]],
235
+ uniform int tex_tangent_index = 0
236
+ [[
237
+ anno::hidden(),
238
+ anno::in_group("Source"),
239
+ anno::display_name("Coordinate Set"),
240
+ anno::description("Tangent to be to construct the tangent frame."),
241
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
242
+ ]],
243
+
244
+ uniform float2 offset = float2(0.0f, 0.0)
245
+ [[
246
+ anno::in_group("Texture Transform"),
247
+ anno::display_name("Offset"),
248
+ anno::description("The offset of the UV coordinate origin as a factor of the texture dimensions."),
249
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
250
+ ]],
251
+ uniform float rotation = 0.0
252
+ [[
253
+ anno::hard_range(0.0, 2.0 * ::math::PI),
254
+ anno::in_group("Texture Transform"),
255
+ anno::display_name("Rotation"),
256
+ anno::description("Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise."),
257
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
258
+ ]],
259
+ uniform float2 scale = float2(1.0f, 1.0f)
260
+ [[
261
+ anno::in_group("Texture Transform"),
262
+ anno::display_name("Scale"),
263
+ anno::description("The scale factor applied to the components of the UV coordinates."),
264
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
265
+ ]],
266
+
267
+ uniform gltf_wrapping_mode wrap_s = repeat
268
+ [[
269
+ anno::in_group("Sampler"),
270
+ anno::display_name("Wrap S"),
271
+ anno::description("S (U) wrapping mode."),
272
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
273
+ ]],
274
+ uniform gltf_wrapping_mode wrap_t = repeat
275
+ [[
276
+ anno::in_group("Sampler"),
277
+ anno::display_name("Wrap T"),
278
+ anno::description("T (V) wrapping mode."),
279
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
280
+ ]]
281
+ )
282
+ [[
283
+ anno::author("NVIDIA Corporation"),
284
+ anno::display_name("GLTF Normal Texture Lookup"),
285
+ anno::description("Function to read a normal texture.")
286
+ ]]
287
+ {
288
+ gltf_normal_texture_lookup_value tex_ret;
289
+ if (!::tex::texture_isvalid(texture))
290
+ return tex_ret;
291
+
292
+ float3 tex_coord3 = state::texture_coordinate(tex_coord_index);
293
+ float2 tex_coord = khr_texture_transform_apply(
294
+ coord: float2(tex_coord3.x, tex_coord3.y),
295
+ offset: offset,
296
+ rotation: rotation,
297
+ scale: scale);
298
+
299
+ tex_ret.value = base::tangent_space_normal_texture(
300
+ texture: texture,
301
+ factor: normal_scale_factor,
302
+ uvw: base::texture_coordinate_info(
303
+ position: float3(tex_coord.x, tex_coord.y, tex_coord3.z),
304
+ tangent_u: state::texture_tangent_u(tex_tangent_index),
305
+ tangent_v: state::texture_tangent_v(tex_tangent_index)),
306
+ wrap_u: convert_wrap_mode(wrap_s),
307
+ wrap_v: convert_wrap_mode(wrap_t));
308
+ tex_ret.valid = true;
309
+ return tex_ret;
310
+ }
311
+
312
+ export material gltf_material(
313
+ // base color
314
+ uniform color base_color_factor = color(1.0)
315
+ [[
316
+ anno::in_group("Metallic Roughness"),
317
+ anno::display_name("Base Color Factor"),
318
+ anno::description("The base color of the material. Multiplied to the 'Base Color Texture' if available.")
319
+ ]],
320
+
321
+ gltf_texture_lookup_value base_color_texture = gltf_texture_lookup()
322
+ [[
323
+ anno::in_group("Metallic Roughness"),
324
+ anno::display_name("Base Color Texture"),
325
+ anno::description("The base color of the material. Influenced by the 'Base Color Factor'.")
326
+ ]],
327
+
328
+ // KHR_materials_specular
329
+ uniform float specular_factor = 1.0
330
+ [[
331
+ anno::hard_range(0.0, 1.0),
332
+ anno::in_group("Specular"),
333
+ anno::display_name("Specular Factor"),
334
+ anno::description("The strength of the specular reflection. Multiplied to the 'Specular Texture' if available.")
335
+ ]],
336
+ gltf_texture_lookup_value specular_texture = gltf_texture_lookup()
337
+ [[
338
+ anno::in_group("Specular"),
339
+ anno::display_name("Specular Texture"),
340
+ anno::description("A texture that defines the strength of the specular reflection, stored in the alpha (A) channel. This will be multiplied by the 'Specular Factor'.")
341
+ ]],
342
+ uniform color specular_color_factor = color(1.0)
343
+ [[
344
+ anno::in_group("Specular"),
345
+ anno::display_name("Specular Color Factor"),
346
+ anno::description("The F0 color of the specular reflection (linear RGB). Multiplied to the 'Specular Color Texture' if available.")
347
+ ]],
348
+ gltf_texture_lookup_value specular_color_texture = gltf_texture_lookup()
349
+ [[
350
+ anno::in_group("Specular"),
351
+ anno::display_name("Specular Color Texture"),
352
+ anno::description("A texture that defines the F0 color of the specular reflection, stored in the RGB channels and encoded in sRGB. This texture will be multiplied by 'Specular Color Factor'.")
353
+ ]],
354
+
355
+ // metallic roughness
356
+ uniform float metallic_factor = 1.0
357
+ [[
358
+ anno::hard_range(0.0, 1.0),
359
+ anno::in_group("Metallic Roughness"),
360
+ anno::display_name("Metallic Factor"),
361
+ anno::description("The metalness of the material. Select between dielectric (0.0) and metallic (1.0). Multiplied to the 'Metal/Rough Texture' value if available.")
362
+ ]],
363
+
364
+ uniform float roughness_factor = 1.0
365
+ [[
366
+ anno::hard_range(0.0, 1.0),
367
+ anno::in_group("Metallic Roughness"),
368
+ anno::display_name("Roughness Factor"),
369
+ anno::description("The roughness of the material. Select between very glossy (0.0) and dull (1.0). Multiplied to the 'Metal/Rough Texture' value if available.")
370
+ ]],
371
+ gltf_texture_lookup_value metallic_roughness_texture = gltf_texture_lookup()
372
+ [[
373
+ anno::in_group("Metallic Roughness"),
374
+ anno::display_name("Metal/Rough Texture"),
375
+ anno::description("Metallic in the red or blue component and roughness in the green component. Influenced by the 'Metallic Factor' and 'Roughness Factor'."),
376
+ anno::enable_if("metallic_factor>0.0 || roughness_factor>0.0")
377
+ ]],
378
+
379
+ // KHR_materials_ior
380
+ uniform float ior = 1.5
381
+ [[
382
+ anno::hard_range(1.00, 5.0),
383
+ anno::in_group("Metallic Roughness"),
384
+ anno::display_name("IOR"),
385
+ anno::description("The index of refraction.")
386
+ ]],
387
+
388
+ // normal map
389
+ gltf_normal_texture_lookup_value normal_texture = gltf_normal_texture_lookup()
390
+ [[
391
+ anno::in_group("Normal Mapping"),
392
+ anno::display_name("Normal Texture"),
393
+ anno::description("Base layer normal map.")
394
+ ]],
395
+
396
+ // KHR_materials_transmission
397
+ uniform float transmission_factor = 0.0
398
+ [[
399
+ anno::hard_range(0.0, 1.0),
400
+ anno::in_group("Transmission"),
401
+ anno::display_name("Transmission Factor"),
402
+ anno::description("The base percentage of light that is transmitted through the surface. Multiplied to the 'Transmission Texture' if available.")
403
+ ]],
404
+ gltf_texture_lookup_value transmission_texture = gltf_texture_lookup()
405
+ [[
406
+ anno::in_group("Transmission"),
407
+ anno::display_name("Transmission Texture"),
408
+ anno::description("A texture that defines the transmission percentage of the surface, stored in the R channel. Influenced by the 'Transmission Factor'."),
409
+ anno::enable_if("transmission_factor>0")
410
+ ]],
411
+
412
+ // KHR_materials_sheen
413
+ uniform color sheen_color_factor = color(0.0)
414
+ [[
415
+ anno::in_group("Sheen"),
416
+ anno::display_name("Sheen Color Factor"),
417
+ anno::description("The sheen color in linear space. Multiplied to the 'Sheen Color Texture' if available.")
418
+ ]],
419
+ gltf_texture_lookup_value sheen_color_texture = gltf_texture_lookup()
420
+ [[
421
+ anno::in_group("Sheen"),
422
+ anno::display_name("Sheen Color Texture"),
423
+ anno::description("The sheen color (RGB). The sheen color is in sRGB transfer function. Influenced by the 'Sheen Color Factor'.")
424
+ ]],
425
+ uniform float sheen_roughness_factor = 0.0
426
+ [[
427
+ anno::hard_range(0.0, 1.0),
428
+ anno::in_group("Sheen"),
429
+ anno::display_name("Sheen Roughness Factor"),
430
+ anno::description("The sheen roughness. Multiplied to the 'Sheen Roughness Texture' if available.")
431
+ ]],
432
+ gltf_texture_lookup_value sheen_roughness_texture = gltf_texture_lookup()
433
+ [[
434
+ anno::in_group("Sheen"),
435
+ anno::display_name("Sheen Roughness Texture"),
436
+ anno::description("The sheen roughness (Alpha) texture. Influenced by the 'Sheen Roughness Factor'.")
437
+ ]],
438
+
439
+ // KHR_materials_clearcoat
440
+ uniform float clearcoat_factor = 0.0
441
+ [[
442
+ anno::hard_range(0.0, 1.0),
443
+ anno::in_group("Clearcoat"),
444
+ anno::display_name("Clearcoat Factor"),
445
+ anno::description("Strength of the clearcoat. Multiplied to the 'Clearcoat Texture' if available.")
446
+ ]],
447
+ gltf_texture_lookup_value clearcoat_texture = gltf_texture_lookup()
448
+ [[
449
+ anno::in_group("Clearcoat"),
450
+ anno::display_name("Clearcoat Texture"),
451
+ anno::description("Strength of the clearcoat. Influenced by the 'Clearcoat Factor'."),
452
+ anno::enable_if("clearcoat_factor>0")
453
+ ]],
454
+ uniform float clearcoat_roughness_factor = 0.0
455
+ [[
456
+ anno::hard_range(0.0, 1.0),
457
+ anno::in_group("Clearcoat"),
458
+ anno::display_name("Clearcoat Roughness Factor"),
459
+ anno::description("The clearcoat layer roughness. Multiplied to the 'Clearcoat Roughness Texture' if available."),
460
+ anno::enable_if("clearcoat_factor>0.0")
461
+ ]],
462
+ gltf_texture_lookup_value clearcoat_roughness_texture = gltf_texture_lookup()
463
+ [[
464
+ anno::in_group("Clearcoat"),
465
+ anno::display_name("Clearcoat Roughness Texture"),
466
+ anno::description("The clearcoat layer roughness texture. Influenced by the 'Clearcoat Roughness Texture'."),
467
+ anno::enable_if("clearcoat_factor>0.0 && clearcoat_roughness_factor>0.0")
468
+ ]],
469
+ gltf_normal_texture_lookup_value clearcoat_normal_texture = gltf_normal_texture_lookup()
470
+ [[
471
+ anno::in_group("Clearcoat"),
472
+ anno::display_name("Clearcoat Normal"),
473
+ anno::description("The clearcoat normal map texture."),
474
+ anno::enable_if("clearcoat_factor>0.0")
475
+ ]],
476
+
477
+ // emission
478
+ uniform color emissive_factor = color(0.0)
479
+ [[
480
+ anno::in_group("Emission"),
481
+ anno::display_name("Emissive Factor"),
482
+ anno::description("The emissive color of the material. Multiplied to the 'Emissive Texture' if available.")
483
+ ]],
484
+ gltf_texture_lookup_value emissive_texture = gltf_texture_lookup()
485
+ [[
486
+ anno::in_group("Emission"),
487
+ anno::display_name("Emissive Texture"),
488
+ anno::description("The emissive map texture. Influenced by the 'Emissive Factor'."),
489
+ anno::enable_if("::math::average(emissive_factor)>0.0")
490
+ ]],
491
+ // KHR_materials_emissive_strength
492
+ uniform float emissive_strength = 1.0
493
+ [[
494
+ anno::soft_range(0.0, 1000),
495
+ anno::in_group("Emission"),
496
+ anno::display_name("Emissive Strength"),
497
+ anno::description("The maximum strength of the emissive texture. Multiplied to the 'Emissive Factor'."),
498
+ anno::enable_if("::math::average(emissive_factor)>0.0")
499
+ ]],
500
+
501
+ // KHR_materials_volume
502
+ uniform bool thin_walled = true
503
+ [[
504
+ anno::in_group("Volume"),
505
+ anno::display_name("Thin-walled"),
506
+ anno::description("If true the material is thin-walled. Otherwise the material is a volume boundary. The doubleSided property has no effect on volume boundaries. Note, the thickness parameters are ignored since ray-tracing is used to compute the travelled distance within the volume.")
507
+ ]],
508
+ uniform float attenuation_distance = 0.0
509
+ [[
510
+ anno::soft_range(0.0, ::limits::FLOAT_MAX),
511
+ anno::in_group("Volume"),
512
+ anno::display_name("Attenuation Distance"),
513
+ anno::description("Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space. A value 0.0 disables it")
514
+ ]],
515
+ uniform color attenuation_color = color(1.0)
516
+ [[
517
+ anno::in_group("Volume"),
518
+ anno::display_name("Attenuation Color"),
519
+ anno::description("The color that white light turns into due to absorption when reaching the attenuation distance.")
520
+ ]],
521
+
522
+ // ambient occlusion
523
+ gltf_texture_lookup_value occlusion_texture = gltf_texture_lookup()
524
+ [[
525
+ anno::in_group("Occlusion"),
526
+ anno::display_name("Occlusion Texture"),
527
+ anno::description("The occlusion map texture. Influenced by the 'Occlusion Strength'.")
528
+ ]],
529
+ uniform float occlusion_strength = 1.0
530
+ [[
531
+ anno::hard_range(0.0, 1.0),
532
+ anno::in_group("Occlusion"),
533
+ anno::display_name("Occlusion Strength"),
534
+ anno::description("A scalar multiplier controlling the amount of occlusion applied. Multiplied to the 'Occlusion Texture'.")
535
+ ]],
536
+
537
+ // alpha
538
+ uniform gltf_alpha_mode alpha_mode = opaque
539
+ [[
540
+ anno::in_group("Opacity"),
541
+ anno::display_name("Alpha Mode"),
542
+ anno::description("Select how to interpret the alpha value.")
543
+ ]],
544
+ uniform float base_alpha = 1.0
545
+ [[
546
+ anno::hard_range(0.0, 1.0),
547
+ anno::in_group("Opacity"),
548
+ anno::display_name("Base Alpha"),
549
+ anno::description("Select between transparent (0.0) and opaque (1.0). Multiplied to the base color texture alpha channel if available."),
550
+ anno::enable_if("alpha_mode!=opaque")
551
+ ]],
552
+ // alpha for gltf_alpha_mode::mask
553
+ uniform float alpha_cutoff = 0.5
554
+ [[
555
+ anno::hard_range(0.0, 1.0),
556
+ anno::in_group("Opacity"),
557
+ anno::display_name("Alpha Cutoff"),
558
+ anno::description("Threshold to decide between fully transparent and fully opaque when alpha mode is 'mask'."),
559
+ anno::enable_if("alpha_mode==mask")
560
+ ]],
561
+
562
+ uniform string vertex_color_name = string("displayColor")
563
+ [[
564
+ anno::in_group("Primvar"),
565
+ anno::display_name("Vertex Color Name"),
566
+ anno::description("Name of the vertex color primvar usually COLOR_0(gltf), or displayColor(usd)")
567
+ ]],
568
+
569
+ uniform bool use_vertex_color_alpha = false
570
+ [[
571
+ anno::in_group("Primvar"),
572
+ anno::display_name("Use Opacity Channel From Vertex Color"),
573
+ anno::description("Multipy the Alpha or .w channel from the vertex color with the base alpha value.")
574
+ ]],
575
+
576
+ uniform string vertex_opacity_name = string("displayOpacity")
577
+ [[
578
+ anno::in_group("Primvar"),
579
+ anno::display_name("Vertex Opacity Name"),
580
+ anno::description("Name of the vertex opacity primvar usually the fourth component of COLOR_0(gltf), or displayOpacity(usd)")
581
+ ]]
582
+
583
+ ) [[
584
+ anno::author("NVIDIA Corporation"),
585
+ anno::display_name("GLTF Material - Metallic-Roughness"),
586
+ anno::description("Metallic-Roughness Material that takes the GLTF PBR model and KHR extension parameters as input.")
587
+ ]] = let {
588
+
589
+ // handling GLTF parameters
590
+ // ------------------------------------------------------------------------
591
+
592
+ float4 base_float4 = gltf_prepare_tex_float4(base_color_texture) * ::scene::data_lookup_float4(vertex_color_name, float4(1.0)); // apply vertex color
593
+ color base_color = base_color_factor * color(base_float4.x, base_float4.y, base_float4.z);
594
+
595
+ float alpha = base_alpha * (use_vertex_color_alpha == 1 ? base_float4.w : 1.0) * ((vertex_color_name != vertex_opacity_name) ? ::scene::data_lookup_float(vertex_opacity_name, float(1.0)) : 1.0);
596
+
597
+ float3 metallic_roughness = gltf_prepare_tex_float3(metallic_roughness_texture);
598
+ float metallic = metallic_factor * metallic_roughness.z;
599
+ float roughness = roughness_factor * metallic_roughness.y;
600
+
601
+ float3 normal = gltf_prepare_normal(normal_texture);
602
+ float occlusion = gltf_prepare_occlusion(occlusion_texture, occlusion_strength);
603
+ color emissive_color = gltf_perpare_emission(emissive_texture, emissive_factor * math::max(0.0f, emissive_strength));
604
+
605
+ // KHR_materials_specular
606
+ // ------------------------------------------------------------------------
607
+ color specular_color = color(gltf_prepare_tex_float3(specular_color_texture)) * specular_color_factor;
608
+ float specular = gltf_prepare_tex_float4(specular_texture).w * specular_factor;
609
+
610
+ // KHR_materials_transmission
611
+ // ------------------------------------------------------------------------
612
+ float transmission = gltf_prepare_tex_float4(transmission_texture).x * transmission_factor;
613
+
614
+ // KHR_materials_sheen
615
+ // ------------------------------------------------------------------------
616
+ color sheen_color = color(gltf_prepare_tex_float3(sheen_color_texture)) * sheen_color_factor;
617
+ float sheen_roughness = gltf_prepare_tex_float4(sheen_roughness_texture).w * sheen_roughness_factor;
618
+
619
+ // KHR_materials_clearcoat
620
+ // ------------------------------------------------------------------------
621
+ float clearcoat_blend = gltf_prepare_tex_float3(clearcoat_texture).x * clearcoat_factor;
622
+ float clearcoat_roughness = gltf_prepare_tex_float3(clearcoat_roughness_texture).y * clearcoat_roughness_factor;
623
+ float clearcoat_roughness2 = clearcoat_roughness * clearcoat_roughness;
624
+ float3 clearcoat_normal = gltf_prepare_normal(clearcoat_normal_texture);
625
+ float grazing_refl_coat = math::max((1.0 - clearcoat_roughness), 0.0);
626
+
627
+ // metallic roughness model
628
+ // ------------------------------------------------------------------------
629
+
630
+ // compute final roughness by squaring the "roughness" parameter
631
+ float roughness2 = roughness * roughness;
632
+
633
+ // reduce the reflectivity at grazing angles to avoid "dark edges"
634
+ // for high roughness due to the layering
635
+ float grazing_refl = math::max((1.0 - roughness), 0.0);
636
+
637
+ // fresnel term based on ior
638
+ float f0 = math::pow((ior - 1.0)/(ior + 1.0), 2.0);
639
+
640
+ // for the dielectric component we layer the glossy component on top of the diffuse one,
641
+ // the glossy layer has no color tint
642
+ bsdf dielectric_component = df::color_custom_curve_layer(
643
+ weight: color(1.0), // roughness is used to weight between diffuse and glossy
644
+ normal_reflectivity: math::min(f0 * specular_color, color(1.0)) * specular,
645
+ grazing_reflectivity: color(grazing_refl * specular),
646
+ layer: df::microfacet_ggx_vcavities_bsdf(roughness_u: roughness2),
647
+ base: df::weighted_layer(
648
+ weight: transmission,
649
+ base: df::diffuse_reflection_bsdf(tint: base_color * occlusion),
650
+ layer: df::microfacet_ggx_vcavities_bsdf(
651
+ roughness_u: roughness2,
652
+ tint: base_color * occlusion,
653
+ mode: df::scatter_transmit)),
654
+ normal: normal
655
+ );
656
+
657
+ // the metallic component doesn't have a diffuse component,
658
+ // its only glossy base_color is applied to tint it
659
+ bsdf metallic_component = df::microfacet_ggx_vcavities_bsdf(
660
+ tint: base_color * occlusion,
661
+ roughness_u: roughness2);
662
+
663
+ // apply sheen to the dielectic component
664
+ // add the sheen_color as weight in an outer layer to be able to blend and disable on default
665
+ // otherwise, sheen would be applied and tinted black
666
+ bsdf dielectric_sheen_component = df::color_weighted_layer(
667
+ weight: sheen_color,
668
+ layer: df::sheen_bsdf(
669
+ roughness: sheen_roughness * sheen_roughness,
670
+ tint: color(1.0),
671
+ multiscatter_tint: color(1.0),
672
+ multiscatter: dielectric_component
673
+ ),
674
+ base: dielectric_component);
675
+
676
+ // final BSDF is a linear blend between dielectric and metallic component
677
+ bsdf dielectric_metal_mix = df::weighted_layer(
678
+ weight: metallic,
679
+ base: dielectric_sheen_component,
680
+ layer: metallic_component,
681
+ normal: normal);
682
+
683
+ bsdf clearcoated = df::custom_curve_layer(
684
+ weight: clearcoat_blend,
685
+ normal_reflectivity: 0.04,
686
+ grazing_reflectivity: grazing_refl_coat,
687
+ layer: df::microfacet_ggx_vcavities_bsdf(
688
+ mode: df::scatter_reflect,
689
+ roughness_u: clearcoat_roughness2,
690
+ tint: color(1.0)),
691
+ base: df::weighted_layer(
692
+ weight: 1.0,
693
+ layer: dielectric_metal_mix,
694
+ normal: normal),
695
+ normal: clearcoat_normal);
696
+
697
+ } in material(
698
+ thin_walled: thin_walled,
699
+ surface: material_surface(
700
+ scattering: clearcoated,
701
+ emission: material_emission (
702
+ emission: df::diffuse_edf(),
703
+ intensity: emissive_color * ::math::PI
704
+ )
705
+ ),
706
+ volume: material_volume(
707
+ absorption_coefficient: thin_walled ? color(0.0) : (attenuation_distance == 0) ? color(0.0) : -math::log(attenuation_color) / attenuation_distance
708
+ ),
709
+ ior: color(ior),
710
+ geometry: material_geometry(
711
+ cutout_opacity: compute_opacity(alpha_mode, alpha, alpha_cutoff)
712
+ )
713
+ );
714
+
715
+
716
+ export material gltf_material_khr_specular_glossiness(
717
+ // diffuse color
718
+ uniform color diffuse_factor = color(1.0)
719
+ [[
720
+ anno::in_group("PBR Specular Glossiness"),
721
+ anno::display_name("Diffuse Factor"),
722
+ anno::description("The diffuse color of the material. Multiplied to the 'Diffuse Texture' if available.")
723
+ ]],
724
+ gltf_texture_lookup_value diffuse_texture = gltf_texture_lookup()
725
+ [[
726
+ anno::in_group("PBR Specular Glossiness"),
727
+ anno::display_name("Diffuse Texture"),
728
+ anno::description("The diffuse color of the material. Influenced by the 'Diffuse Factor'.")
729
+ ]],
730
+
731
+ // specular glossiness
732
+ uniform color specular_factor = 1.0
733
+ [[
734
+ anno::in_group("PBR Specular Glossiness"),
735
+ anno::display_name("Specular Factor"),
736
+ anno::description("The specular color of the material. Multiplied to the rgb values of the 'Specular/Glossy Texture' if available.")
737
+ ]],
738
+ uniform float glossiness_factor = 1.0
739
+ [[
740
+ anno::hard_range(0.0, 1.0),
741
+ anno::in_group("PBR Specular Glossiness"),
742
+ anno::display_name("Glossiness Factor"),
743
+ anno::description("The glossiness of the material. Select between diffuse (0.0) and nearly specular (1.0). Multiplied to the alpha value of the 'Specular/Glossy Texture' if available.")
744
+ ]],
745
+ gltf_texture_lookup_value specular_glossiness_texture = gltf_texture_lookup()
746
+ [[
747
+ anno::in_group("PBR Specular Glossiness"),
748
+ anno::display_name("Specular/Glossy Texture"),
749
+ anno::description("The specular-glossiness texture. Influenced by the 'Specular Factor' and 'Glossiness Factor'.")
750
+ ]],
751
+
752
+ // normal map
753
+ gltf_normal_texture_lookup_value normal_texture = gltf_normal_texture_lookup()
754
+ [[
755
+ anno::in_group("Normal Mapping"),
756
+ anno::display_name("Normal Texture"),
757
+ anno::description("Base layer normal map.")
758
+ ]],
759
+
760
+ // emission
761
+ uniform color emissive_factor = color(0.0)
762
+ [[
763
+ anno::in_group("Emission"),
764
+ anno::display_name("Emissive Factor"),
765
+ anno::description("The emissive color of the material. Multiplied to the 'Emissive Texture' if available.")
766
+ ]],
767
+ gltf_texture_lookup_value emissive_texture = gltf_texture_lookup()
768
+ [[
769
+ anno::in_group("Emission"),
770
+ anno::display_name("Emissive Texture"),
771
+ anno::description("The emissive map texture. Influenced by the 'Emissive Factor'."),
772
+ anno::enable_if("::math::average(emissive_factor)>0.0")
773
+ ]],
774
+ // KHR_materials_emissive_strength
775
+ uniform float emissive_strength = 1.0
776
+ [[
777
+ anno::soft_range(0.0, 10000),
778
+ anno::in_group("Emission"),
779
+ anno::display_name("Emissive Strength"),
780
+ anno::description("The maximum strength of the emissive texture. Multiplied to the 'Emissive Factor'."),
781
+ anno::enable_if("::math::average(emissive_factor)>0.0")
782
+ ]],
783
+
784
+ // ambient occlusion
785
+ gltf_texture_lookup_value occlusion_texture = gltf_texture_lookup()
786
+ [[
787
+ anno::in_group("Occlusion"),
788
+ anno::display_name("Occlusion Texture"),
789
+ anno::description("The occlusion map texture. Influenced by the 'Occlusion Strength'.")
790
+ ]],
791
+ uniform float occlusion_strength = 1.0
792
+ [[
793
+ anno::hard_range(0.0, 1.0),
794
+ anno::in_group("Occlusion"),
795
+ anno::display_name("Occlusion Strength"),
796
+ anno::description("A scalar multiplier controlling the amount of occlusion applied. Multiplied to the 'Occlusion Texture'.")
797
+ ]],
798
+
799
+ // alpha
800
+ uniform gltf_alpha_mode alpha_mode = opaque
801
+ [[
802
+ anno::in_group("Opacity"),
803
+ anno::display_name("Alpha Mode"),
804
+ anno::description("Select how to interpret the alpha value.")
805
+ ]],
806
+ uniform float base_alpha = 1.0
807
+ [[
808
+ anno::hard_range(0.0, 1.0),
809
+ anno::in_group("Opacity"),
810
+ anno::display_name("Base Alpha"),
811
+ anno::description("Select between transparent (0.0) and opaque (1.0). Multiplied to the base color texture alpha channel if available."),
812
+ anno::enable_if("alpha_mode!=opaque")
813
+ ]],
814
+ // alpha for gltf_alpha_mode::mask
815
+
816
+ uniform float alpha_cutoff = 0.5
817
+ [[
818
+ anno::hard_range(0.0, 1.0),
819
+ anno::in_group("Opacity"),
820
+ anno::display_name("Alpha Cutoff"),
821
+ anno::description("Threshold to decide between fully transparent and fully opaque when alpha mode is 'mask'."),
822
+ anno::enable_if("alpha_mode==mask")
823
+ ]],
824
+
825
+ uniform string vertex_color_name_spec = string("displayColor")
826
+ [[
827
+ anno::in_group("Primvar"),
828
+ anno::display_name("Vertex Color Name"),
829
+ anno::description("Name of the vertex color primvar usually COLOR_0 'gltf', or displayColor 'usd'.")
830
+ ]],
831
+
832
+ uniform bool use_vertex_color_alpha_spec = false
833
+ [[
834
+ anno::in_group("Primvar"),
835
+ anno::display_name("Use Opacity Channel From Vertex Color"),
836
+ anno::description("Multipy the Alpha or .w channel from the vertex color with the base alpha value.")
837
+ ]],
838
+
839
+ uniform string vertex_opacity_name_spec = string("displayOpacity")
840
+ [[
841
+ anno::in_group("Primvar"),
842
+ anno::display_name("Vertex Opacity Name"),
843
+ anno::description("Name of the vertex color primvar usually the .w component of COLOR_0 'gltf', or displayOpacity 'usd'.")
844
+ ]]
845
+
846
+ ) [[
847
+ anno::author("NVIDIA Corporation"),
848
+ anno::display_name("GLTF Material - Specular-Glossiness"),
849
+ anno::description("Specular-Glossiness Material that takes the GLTF KHR extension parameters as input.")
850
+ ]] = let {
851
+
852
+ // handling GLTF parameters
853
+ // ------------------------------------------------------------------------
854
+ float4 diffuse_float4 = gltf_prepare_tex_float4(diffuse_texture) * ::scene::data_lookup_float4(vertex_color_name_spec, float4(1.0)); // apply vertex color
855
+ color diffuse = diffuse_factor * color(diffuse_float4.x, diffuse_float4.y, diffuse_float4.z);
856
+
857
+ float alpha = base_alpha * (use_vertex_color_alpha_spec == 1 ? diffuse_float4.w : 1.0) * ((vertex_color_name_spec != vertex_opacity_name_spec) ? ::scene::data_lookup_float(vertex_opacity_name_spec, float(1.0)) : 1.0);
858
+ //float alpha = base_alpha;
859
+ float4 specular_glossiness = gltf_prepare_tex_float4(specular_glossiness_texture);
860
+ color specular = specular_factor * color(specular_glossiness.x, specular_glossiness.y, specular_glossiness.z);
861
+ float glossiness = glossiness_factor * specular_glossiness.w;
862
+
863
+ float3 normal = gltf_prepare_normal(normal_texture);
864
+ float occlusion = gltf_prepare_occlusion(occlusion_texture, occlusion_strength);
865
+ color emissive_color = gltf_perpare_emission(emissive_texture, emissive_factor * math::max(0.0f, emissive_strength));
866
+
867
+ // specular glossiness model
868
+ // ------------------------------------------------------------------------
869
+
870
+ //color c_diff = diffuse * (1.0 - math::maxvalue(specular));
871
+ float F_0 = math::max_value(specular);
872
+ color F_0_tint = F_0==0.0? color(0.0) : (specular/F_0);
873
+
874
+ float a = (1.0 - glossiness) * (1.0 - glossiness);
875
+
876
+ // diffuse BRDF
877
+ bsdf diffuse_brdf = df::diffuse_reflection_bsdf(
878
+ tint: diffuse * occlusion,
879
+ roughness: 0.0);
880
+
881
+ // specular BRDF
882
+ bsdf specular_brdf = df::microfacet_ggx_smith_bsdf(
883
+ tint: color(occlusion),
884
+ roughness_u: a,
885
+ roughness_v: a,
886
+ tangent_u: state::texture_tangent_u(0));
887
+ bsdf tinted_specular = df::directional_factor(normal_tint: F_0_tint, grazing_tint: color(1.0), exponent: 5.0, base: specular_brdf);
888
+ //- Custom curve for specular/diffuse angular mix
889
+ bsdf diffuse_specular_mix = df::custom_curve_layer(
890
+ normal_reflectivity: F_0,
891
+ grazing_reflectivity: 1.0,
892
+ exponent: 5.0,
893
+ weight: 1.0,
894
+ layer: tinted_specular,
895
+ base: diffuse_brdf,
896
+ normal: normal);
897
+
898
+ } in material(
899
+ surface: material_surface(
900
+ scattering: diffuse_specular_mix,
901
+ emission: material_emission (
902
+ emission: df::diffuse_edf(),
903
+ intensity: emissive_color * ::math::PI
904
+ )
905
+ ),
906
+ geometry: material_geometry(
907
+ normal: normal,
908
+ cutout_opacity: compute_opacity(alpha_mode, alpha, alpha_cutoff)
909
+ )
910
+ );
saved/assets/miscs/curobo/R5a/LICENSE.curobo ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+
3
+
4
+ NVIDIA License
5
+
6
+ 1. Definitions
7
+
8
+ “Licensor” means any person or entity that distributes its Work.
9
+ “Work” means (a) the original work of authorship made available under this license, which may
10
+ include software, documentation, or other files, and (b) any additions to or derivative works
11
+ thereof that are made available under this license.
12
+ The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as
13
+ provided under U.S. copyright law; provided, however, that for the purposes of this license,
14
+ derivative works shall not include works that remain separable from, or merely link (or bind by
15
+ name) to the interfaces of, the Work.
16
+
17
+ Works are “made available” under this license by including in or with the Work either (a) a
18
+ copyright notice referencing the applicability of this license to the Work, or (b) a copy of
19
+ this license.
20
+
21
+ 2. License Grant
22
+
23
+ 2.1 Copyright Grant. Subject to the terms and conditions of this license, each Licensor grants to
24
+ you a perpetual, worldwide, non-exclusive, royalty-free, copyright license to use, reproduce,
25
+ prepare derivative works of, publicly display, publicly perform, sublicense and distribute its Work
26
+ and any resulting derivative works in any form.
27
+
28
+ 3. Limitations
29
+
30
+ 3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this
31
+ license, (b) you include a complete copy of this license with your distribution, and (c) you retain
32
+ without modification any copyright, patent, trademark, or attribution notices that are present in
33
+ the Work.
34
+
35
+ 3.2 Derivative Works. You may specify that additional or different terms apply to the use,
36
+ reproduction, and distribution of your derivative works of the Work (“Your Terms”) only if (a)
37
+ Your Terms provide that the use limitation in Section 3.3 applies to your derivative works, and (b)
38
+ you identify the specific derivative works that are subject to Your Terms. Notwithstanding Your
39
+ Terms, this license (including the redistribution requirements in Section 3.1) will continue to
40
+ apply to the Work itself.
41
+
42
+ 3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for
43
+ use non-commercially. Notwithstanding the foregoing, NVIDIA Corporation and its affiliates may use
44
+ the Work and any derivative works commercially. As used herein, “non-commercially” means for
45
+ research or evaluation purposes only.
46
+
47
+ 3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including
48
+ any claim, cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are
49
+ infringed by any Work, then your rights under this license from such Licensor (including the grant
50
+ in Section 2.1) will terminate immediately.
51
+
52
+ 3.5 Trademarks. This license does not grant any rights to use any Licensor’s or its affiliates’
53
+ names, logos, or trademarks, except as necessary to reproduce the notices described in this license.
54
+
55
+ 3.6 Termination. If you violate any term of this license, then your rights under this license
56
+ (including the grant in Section 2.1) will terminate immediately.
57
+
58
+ 4. Disclaimer of Warranty.
59
+
60
+ THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
61
+ IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
62
+ TITLE OR NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE.
63
+
64
+ 5. Limitation of Liability.
65
+
66
+ EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT
67
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES,
68
+ INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR
69
+ RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF
70
+ GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER
71
+ DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
72
+
73
+ ****************************************************************************************************
74
+
75
+ This package contains examples that use external assets (urdf and mesh files). Licenses for external
76
+ assets are listed in LICENSE_ASSETS.
77
+
saved/assets/miscs/curobo/R5a/NOTICE.md ADDED
@@ -0,0 +1 @@
 
 
1
+ The r5a_left_arm.yml planner configuration retains its NVIDIA cuRobo template notice and is distributed subject to LICENSE.curobo (research/evaluation use). Robot-specific parameters, URDF and meshes were supplied by the AI Lab team. The simulator and cuRobo implementation are not bundled.
saved/assets/miscs/curobo/R5a/R5a.urdf ADDED
@@ -0,0 +1,511 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
3
+ Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
4
+ For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
5
+ <robot
6
+ name="R5a">
7
+ <link
8
+ name="base_link">
9
+ <inertial>
10
+ <origin
11
+ xyz="-0.00013359 6.672E-05 0.031672"
12
+ rpy="0 0 0" />
13
+ <mass
14
+ value="0.42272" />
15
+ <inertia
16
+ ixx="0.00019"
17
+ ixy="0.00000"
18
+ ixz="0.00000"
19
+ iyy="0.00019"
20
+ iyz="0.00000"
21
+ izz="0.00020" />
22
+ </inertial>
23
+ <visual>
24
+ <origin
25
+ xyz="0 0 0"
26
+ rpy="0 0 0" />
27
+ <geometry>
28
+ <mesh
29
+ filename="meshes/base_link.STL" />
30
+ </geometry>
31
+ <material
32
+ name="">
33
+ <color
34
+ rgba="0.89804 0.91765 0.92941 1" />
35
+ </material>
36
+ </visual>
37
+ <collision>
38
+ <origin
39
+ xyz="0 0 0"
40
+ rpy="0 0 0" />
41
+ <geometry>
42
+ <mesh
43
+ filename="meshes/base_link.STL" />
44
+ </geometry>
45
+ </collision>
46
+ </link>
47
+ <link
48
+ name="link1">
49
+ <inertial>
50
+ <origin
51
+ xyz="0.0050395 -0.0077407 0.020897"
52
+ rpy="0 0 0" />
53
+ <mass
54
+ value="0.096804" />
55
+ <inertia
56
+ ixx="0.00011"
57
+ ixy="-0.00001"
58
+ ixz="0.00001"
59
+ iyy="0.00005"
60
+ iyz="-0.00001"
61
+ izz="0.00010" />
62
+ </inertial>
63
+ <visual>
64
+ <origin
65
+ xyz="0 0 0"
66
+ rpy="0 0 0" />
67
+ <geometry>
68
+ <mesh
69
+ filename="meshes/link1.STL" />
70
+ </geometry>
71
+ <material
72
+ name="">
73
+ <color
74
+ rgba="0.56471 0.56471 0.56471 1" />
75
+ </material>
76
+ </visual>
77
+ <collision>
78
+ <origin
79
+ xyz="0 0 0"
80
+ rpy="0 0 0" />
81
+ <geometry>
82
+ <mesh
83
+ filename="meshes/link1.STL" />
84
+ </geometry>
85
+ </collision>
86
+ </link>
87
+ <joint
88
+ name="joint1"
89
+ type="revolute">
90
+ <origin
91
+ xyz="0 0 0.0565"
92
+ rpy="0 0 0" />
93
+ <parent
94
+ link="base_link" />
95
+ <child
96
+ link="link1" />
97
+ <axis
98
+ xyz="0 0 1" />
99
+ <limit
100
+ lower="-2.094"
101
+ upper="3.1416"
102
+ effort="100"
103
+ velocity="1000" />
104
+ </joint>
105
+ <link
106
+ name="link2">
107
+ <inertial>
108
+ <origin
109
+ xyz="-0.12992 -0.0011822 -2.6366E-05"
110
+ rpy="0 0 0" />
111
+ <mass
112
+ value="1.1988" />
113
+ <inertia
114
+ ixx="0.00065"
115
+ ixy="0.00008"
116
+ ixz="0.00000"
117
+ iyy="0.01647"
118
+ iyz="0.00000"
119
+ izz="0.01646" />
120
+ </inertial>
121
+ <visual>
122
+ <origin
123
+ xyz="0 0 0"
124
+ rpy="0 0 0" />
125
+ <geometry>
126
+ <mesh
127
+ filename="meshes/link2.STL" />
128
+ </geometry>
129
+ <material
130
+ name="">
131
+ <color
132
+ rgba="0.79216 0.81961 0.93333 1" />
133
+ </material>
134
+ </visual>
135
+ <collision>
136
+ <origin
137
+ xyz="0 0 0"
138
+ rpy="0 0 0" />
139
+ <geometry>
140
+ <mesh
141
+ filename="meshes/link2.STL" />
142
+ </geometry>
143
+ </collision>
144
+ </link>
145
+ <joint
146
+ name="joint2"
147
+ type="revolute">
148
+ <origin
149
+ xyz="0.02 0 0.047"
150
+ rpy="0 0 0" />
151
+ <parent
152
+ link="link1" />
153
+ <child
154
+ link="link2" />
155
+ <axis
156
+ xyz="0 1 0" />
157
+ <limit
158
+ lower="-0.1"
159
+ upper="3.665"
160
+ effort="100"
161
+ velocity="1000" />
162
+ </joint>
163
+ <link
164
+ name="link3">
165
+ <inertial>
166
+ <origin
167
+ xyz="0.16181 0.0011723 -0.05455"
168
+ rpy="0 0 0" />
169
+ <mass
170
+ value="0.84082" />
171
+ <inertia
172
+ ixx="0.00082"
173
+ ixy="0.00008"
174
+ ixz="-0.00074"
175
+ iyy="0.00849"
176
+ iyz="0.00001"
177
+ izz="0.00834" />
178
+ </inertial>
179
+ <visual>
180
+ <origin
181
+ xyz="0 0 0"
182
+ rpy="0 0 0" />
183
+ <geometry>
184
+ <mesh
185
+ filename="meshes/link3.STL" />
186
+ </geometry>
187
+ <material
188
+ name="">
189
+ <color
190
+ rgba="0.89804 0.91765 0.92941 1" />
191
+ </material>
192
+ </visual>
193
+ <collision>
194
+ <origin
195
+ xyz="0 0 0"
196
+ rpy="0 0 0" />
197
+ <geometry>
198
+ <mesh
199
+ filename="meshes/link3.STL" />
200
+ </geometry>
201
+ </collision>
202
+ </link>
203
+ <joint
204
+ name="joint3"
205
+ type="revolute">
206
+ <origin
207
+ xyz="-0.264 0 0"
208
+ rpy="-3.1416 0 0" />
209
+ <parent
210
+ link="link2" />
211
+ <child
212
+ link="link3" />
213
+ <axis
214
+ xyz="0 1 0" />
215
+ <limit
216
+ lower="-0.1"
217
+ upper="3.24"
218
+ effort="100"
219
+ velocity="1000" />
220
+ </joint>
221
+ <link
222
+ name="link4">
223
+ <inertial>
224
+ <origin
225
+ xyz="0.041751 0.0054236 -0.03337"
226
+ rpy="0 0 0" />
227
+ <mass
228
+ value="0.12432" />
229
+ <inertia
230
+ ixx="0.00022"
231
+ ixy="-0.00002"
232
+ ixz="-0.00009"
233
+ iyy="0.00025"
234
+ iyz="0.00002"
235
+ izz="0.00017" />
236
+ </inertial>
237
+ <visual>
238
+ <origin
239
+ xyz="0 0 0"
240
+ rpy="0 0 0" />
241
+ <geometry>
242
+ <mesh
243
+ filename="meshes/link4.STL" />
244
+ </geometry>
245
+ <material
246
+ name="">
247
+ <color
248
+ rgba="0.79216 0.81961 0.93333 1" />
249
+ </material>
250
+ </visual>
251
+ <collision>
252
+ <origin
253
+ xyz="0 0 0"
254
+ rpy="0 0 0" />
255
+ <geometry>
256
+ <mesh
257
+ filename="meshes/link4.STL" />
258
+ </geometry>
259
+ </collision>
260
+ </link>
261
+ <joint
262
+ name="joint4"
263
+ type="revolute">
264
+ <origin
265
+ xyz="0.245 -5E-05 -0.06"
266
+ rpy="0 0 0" />
267
+ <parent
268
+ link="link3" />
269
+ <child
270
+ link="link4" />
271
+ <axis
272
+ xyz="0 1 0" />
273
+ <limit
274
+ lower="-1.671"
275
+ upper="1.671"
276
+ effort="100"
277
+ velocity="1000" />
278
+ </joint>
279
+ <link
280
+ name="link5">
281
+ <inertial>
282
+ <origin
283
+ xyz="-8.3435E-05 -1.5428E-05 0.052216"
284
+ rpy="0 0 0" />
285
+ <mass
286
+ value="0.63601" />
287
+ <inertia
288
+ ixx="0.00084"
289
+ ixy="0.00000"
290
+ ixz="0.00007"
291
+ iyy="0.00082"
292
+ iyz="0.00000"
293
+ izz="0.00026" />
294
+ </inertial>
295
+ <visual>
296
+ <origin
297
+ xyz="0 0 0"
298
+ rpy="0 0 0" />
299
+ <geometry>
300
+ <mesh
301
+ filename="meshes/link5.STL" />
302
+ </geometry>
303
+ <material
304
+ name="">
305
+ <color
306
+ rgba="0.69804 0.69804 0.69804 1" />
307
+ </material>
308
+ </visual>
309
+ <collision>
310
+ <origin
311
+ xyz="0 0 0"
312
+ rpy="0 0 0" />
313
+ <geometry>
314
+ <mesh
315
+ filename="meshes/link5.STL" />
316
+ </geometry>
317
+ </collision>
318
+ </link>
319
+ <joint
320
+ name="joint5"
321
+ type="revolute">
322
+ <origin
323
+ xyz="0.073914 5E-05 -0.083391"
324
+ rpy="0 0 0" />
325
+ <parent
326
+ link="link4" />
327
+ <child
328
+ link="link5" />
329
+ <axis
330
+ xyz="0 0 1" />
331
+ <limit
332
+ lower="-1.671"
333
+ upper="1.671"
334
+ effort="100"
335
+ velocity="1000" />
336
+ </joint>
337
+ <link
338
+ name="link6">
339
+ <inertial>
340
+ <origin
341
+ xyz="0.041697 2.4368E-05 0.00014464"
342
+ rpy="0 0 0" />
343
+ <mass
344
+ value="0.44089" />
345
+ <inertia
346
+ ixx="0.00038"
347
+ ixy="0.00000"
348
+ ixz="0.00000"
349
+ iyy="0.00028"
350
+ iyz="0.00000"
351
+ izz="0.00050" />
352
+ </inertial>
353
+ <visual>
354
+ <origin
355
+ xyz="0 0 0"
356
+ rpy="0 0 0" />
357
+ <geometry>
358
+ <mesh
359
+ filename="meshes/link6.STL" />
360
+ </geometry>
361
+ <material
362
+ name="">
363
+ <color
364
+ rgba="0.89804 0.91765 0.92941 1" />
365
+ </material>
366
+ </visual>
367
+ <collision>
368
+ <origin
369
+ xyz="0 0 0"
370
+ rpy="0 0 0" />
371
+ <geometry>
372
+ <mesh
373
+ filename="meshes/link6.STL" />
374
+ </geometry>
375
+ </collision>
376
+ </link>
377
+ <joint
378
+ name="joint6"
379
+ type="revolute">
380
+ <origin
381
+ xyz="0.025286 0 0.083391"
382
+ rpy="3.1416 0 0" />
383
+ <parent
384
+ link="link5" />
385
+ <child
386
+ link="link6" />
387
+ <axis
388
+ xyz="1 0 0" />
389
+ <limit
390
+ lower="-2.094"
391
+ upper="2.094"
392
+ effort="100"
393
+ velocity="1000" />
394
+ </joint>
395
+ <link
396
+ name="link7">
397
+ <inertial>
398
+ <origin
399
+ xyz="-0.00035522 -0.007827 -0.0029883"
400
+ rpy="0 0 0" />
401
+ <mass
402
+ value="0.064798" />
403
+ <inertia
404
+ ixx="0.00002"
405
+ ixy="0.00000"
406
+ ixz="0.00000"
407
+ iyy="0.00003"
408
+ iyz="0.00000"
409
+ izz="0.00003" />
410
+ </inertial>
411
+ <visual>
412
+ <origin
413
+ xyz="0 0 0"
414
+ rpy="0 0 0" />
415
+ <geometry>
416
+ <mesh
417
+ filename="meshes/link7.STL" />
418
+ </geometry>
419
+ <material
420
+ name="">
421
+ <color
422
+ rgba="1 1 1 1" />
423
+ </material>
424
+ </visual>
425
+ <collision>
426
+ <origin
427
+ xyz="0 0 0"
428
+ rpy="0 0 0" />
429
+ <geometry>
430
+ <mesh
431
+ filename="meshes/link7.STL" />
432
+ </geometry>
433
+ </collision>
434
+ </link>
435
+ <joint
436
+ name="joint7"
437
+ type="prismatic">
438
+ <origin
439
+ xyz="0.08657 0.024896 -0.0002436"
440
+ rpy="0 0 0" />
441
+ <parent
442
+ link="link6" />
443
+ <child
444
+ link="link7" />
445
+ <axis
446
+ xyz="0 1 0" />
447
+ <limit
448
+ lower="0"
449
+ upper="0.044"
450
+ effort="100"
451
+ velocity="1000" />
452
+ </joint>
453
+ <link
454
+ name="link8">
455
+ <inertial>
456
+ <origin
457
+ xyz="-0.000355223470270755 0.00782768751820277 0.00242005642879778"
458
+ rpy="0 0 0" />
459
+ <mass
460
+ value="0.0647981725781684" />
461
+ <inertia
462
+ ixx="0.00002"
463
+ ixy="0.00000"
464
+ ixz="0.00000"
465
+ iyy="0.00003"
466
+ iyz="0.00000"
467
+ izz="0.00003" />
468
+ </inertial>
469
+ <visual>
470
+ <origin
471
+ xyz="0 0 0"
472
+ rpy="0 0 0" />
473
+ <geometry>
474
+ <mesh
475
+ filename="meshes/link8.STL" />
476
+ </geometry>
477
+ <material
478
+ name="">
479
+ <color
480
+ rgba="1 1 1 1" />
481
+ </material>
482
+ </visual>
483
+ <collision>
484
+ <origin
485
+ xyz="0 0 0"
486
+ rpy="0 0 0" />
487
+ <geometry>
488
+ <mesh
489
+ filename="meshes/link8.STL" />
490
+ </geometry>
491
+ </collision>
492
+ </link>
493
+ <joint
494
+ name="joint8"
495
+ type="prismatic">
496
+ <origin
497
+ xyz="0.08657 -0.0249 -0.00024366"
498
+ rpy="0 0 0" />
499
+ <parent
500
+ link="link6" />
501
+ <child
502
+ link="link8" />
503
+ <axis
504
+ xyz="0 -1 0" />
505
+ <limit
506
+ lower="0"
507
+ upper="0.044"
508
+ effort="100"
509
+ velocity="1000" />
510
+ </joint>
511
+ </robot>
saved/assets/miscs/curobo/R5a/meshes/link7.STL ADDED
Binary file (99 kB). View file
 
saved/assets/miscs/curobo/R5a/meshes/link8.STL ADDED
Binary file (99 kB). View file
 
saved/assets/miscs/curobo/R5a/r5a_left_arm.yml ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ##
3
+ ## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ ##
5
+ ## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6
+ ## property and proprietary rights in and to this material, related
7
+ ## documentation and any modifications thereto. Any use, reproduction,
8
+ ## disclosure or distribution of this material and related documentation
9
+ ## without an express license agreement from NVIDIA CORPORATION or
10
+ ## its affiliates is strictly prohibited.
11
+ ##
12
+
13
+ robot_cfg:
14
+ kinematics:
15
+ usd_path: "${ASSETS_DIR}/miscs/curobo/R5a/R5a/R5a.usd"
16
+ usd_robot_root: "/robot"
17
+ isaac_usd_path: ""
18
+ usd_flip_joints: {}
19
+ usd_flip_joint_limits: []
20
+
21
+ urdf_path: "${ASSETS_DIR}/miscs/curobo/R5a/R5a.urdf"
22
+ asset_root_path: "robot"
23
+
24
+ base_link: "base_link"
25
+ ee_link: "link6"
26
+
27
+ extra_links: {"attached_object":{"parent_link_name": "link6" ,
28
+ "link_name": "attached_object", "fixed_transform": [0,0,0,1,0,0,0], "joint_type":"FIXED",
29
+ "joint_name": "attach_joint" }}
30
+
31
+
32
+ collision_link_names:
33
+ [
34
+ "base_link",
35
+ "link1",
36
+ "link2",
37
+ "link3",
38
+ "link4",
39
+ "link5",
40
+ "link6",
41
+ "link7",
42
+ "link8",
43
+ "attached_object",
44
+ ]
45
+ collision_spheres:
46
+ link1:
47
+ - "center": [-0.002, 0.003, 0.037]
48
+ "radius": 0.02
49
+ base_link:
50
+ - "center": [-0.003, -0.0, 0.036]
51
+ "radius": 0.02
52
+ link2:
53
+ - "center": [-0.008, 0.0, -0.001]
54
+ "radius": 0.02929
55
+ - "center": [-0.264, -0.001, 0.01]
56
+ "radius": 0.02864
57
+ - "center": [-0.272, 0.003, -0.009]
58
+ "radius": 0.02602
59
+ - "center": [-0.178, 0.002, -0.002]
60
+ "radius": 0.02733
61
+ - "center": [-0.1, -0.003, -0.005]
62
+ "radius": 0.0208
63
+ link3:
64
+ - "center": [0.025, 0.001, -0.063]
65
+ "radius": 0.02861
66
+ - "center": [0.085, -0.003, -0.062]
67
+ "radius": 0.02274
68
+ - "center": [0.165, -0.008, -0.057]
69
+ "radius": 0.02144
70
+ - "center": [-0.005, -0.019, -0.014]
71
+ "radius": 0.02013
72
+ - "center": [0.091, -0.004, -0.072]
73
+ "radius": 0.01883
74
+ - "center": [0.239, 0.012, -0.073]
75
+ "radius": 0.01883
76
+ link4:
77
+ - "center": [0.016, -0.001, 0.001]
78
+ "radius": 0.02437
79
+ - "center": [0.071, 0.003, -0.052]
80
+ "radius": 0.02302
81
+ link5:
82
+ - "center": [-0.002, 0.006, 0.021]
83
+ "radius": 0.02754
84
+ - "center": [0.003, 0.009, 0.08]
85
+ "radius": 0.02697
86
+ link6:
87
+ - "center": [0.055, 0.001, -0.001]
88
+ "radius": 0.02822
89
+ - "center": [0.035, -0.001, -0.0]
90
+ "radius": 0.02587
91
+ link7:
92
+ - "center": [0.036, -0.015, -0.006]
93
+ "radius": 0.0137
94
+ - "center": [-0.007, -0.003, -0.011]
95
+ "radius": 0.0137
96
+ link8:
97
+ - "center": [0.039, 0.016, -0.005]
98
+ "radius": 0.0137
99
+ - "center": [-0.007, 0.002, -0.009]
100
+ "radius": 0.0137
101
+ collision_sphere_buffer: 0.004
102
+ extra_collision_spheres: {"attached_object": 4}
103
+ self_collision_ignore:
104
+ {
105
+ "base_link": ["link1", "link2", "link3", "link4", "link5", "link6", "link7", "link8", "attached_object"],
106
+ "link1": ["link2", "link3", "link4", "link5", "link6", "link7", "link8", "attached_object"],
107
+ "link2": ["link3", "link4", "link5", "link6", "link7", "link8", "attached_object"],
108
+ "link3": ["link4", "link5", "link6", "link7", "link8", "attached_object"],
109
+ "link4": ["link5", "link6", "link7", "link8", "attached_object"],
110
+ "link5": ["link6", "link7", "link8", "attached_object"],
111
+ "link6": ["link7", "link8", "attached_object"],
112
+ "link7": ["link8", "attached_object"]
113
+ }
114
+ self_collision_buffer:
115
+ {
116
+ "base_link": 0.1,
117
+ "link1": 0.05,
118
+ "link2": 0.05,
119
+ "link3": 0.05,
120
+ "link4": 0.05,
121
+ "link5": 0.05,
122
+ "link6": 0.05,
123
+ "link7": 0.02,
124
+ "link8": 0.02,
125
+ "attached_object": 0.0,
126
+ }
127
+ use_global_cumul: True
128
+ mesh_link_names:
129
+ [
130
+ "base_link",
131
+ "link1",
132
+ "link2",
133
+ "link3",
134
+ "link4",
135
+ "link5",
136
+ "link6",
137
+ "link7",
138
+ "link8"
139
+ ]
140
+ external_asset_path: null # Use this to add path for externally located assets/robot folder.
141
+ lock_joints: {"joint7": 0.044, "joint8": 0.044}
142
+
143
+ cspace:
144
+ joint_names: ["joint1","joint2","joint3","joint4", "joint5", "joint6","joint7","joint8"]
145
+ # retract_config: [0.0, 0.35, -0.35, 0.0, 0.0, 0.0, 0.0, 0.0]
146
+ retract_config: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
147
+ null_space_weight: [1,1,1,1,1,1,1,1]
148
+ cspace_distance_weight: [1,1,1,1,1,1,1,1]
149
+ max_acceleration: 15.0
150
+ max_jerk: 500.0
151
+
152
+
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass.mdl ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.4;
30
+ import ::anno::*;
31
+ import ::base::*;
32
+
33
+ using OmniGlass_Opacity import OmniGlass_Opacity;
34
+ export annotation distill_off();
35
+
36
+ export material OmniGlass(
37
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
38
+ [[
39
+ anno::hidden(),
40
+ anno::unused()
41
+ ]],
42
+ uniform bool use_glass_color_texture = false
43
+ [[
44
+ anno::hidden(),
45
+ anno::unused()
46
+ ]],
47
+ uniform color glass_color = color(1.f, 1.f, 1.f) [[
48
+ anno::display_name("Glass Color"),
49
+ anno::description("Sets the color of the glass"),
50
+ anno::hard_range(color(0.0), color(1.0)),
51
+ anno::in_group("Color")
52
+ ]],
53
+ uniform texture_2d glass_color_texture = texture_2d() [[
54
+ anno::display_name("Glass Color Texture"),
55
+ anno::description("Specifies the texture to be used for the glass color of the material"),
56
+ anno::in_group("Color")
57
+ ]],
58
+ float frosting_roughness = 0.f [[
59
+ anno::display_name("Glass Roughness"),
60
+ anno::description("Sets the roughness of the glass material "),
61
+ anno::hard_range(0.0, 1.0),
62
+ anno::in_group("Roughness")
63
+ ]],
64
+ uniform float glass_ior = 1.491f [[
65
+ anno::display_name("Glass IOR"),
66
+ anno::description("Sets IOR of the glass material "),
67
+ anno::soft_range(1.0f, 4.0f),
68
+ anno::in_group("Refraction")
69
+ ]],
70
+ uniform bool thin_walled = false [[
71
+ anno::display_name("Thin Walled"),
72
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
73
+ anno::in_group("Refraction")
74
+ ]],
75
+
76
+ // NEW PARAMETERS
77
+ uniform float depth = 0.001f [[
78
+ anno::description("Controls how much light is absorbed through the surface"),
79
+ anno::display_name("Volume Absorption Scale"),
80
+ anno::in_group("Color"),
81
+ anno::soft_range(0.f, 1.f),
82
+ anno::hard_range(0.f, 1000.f)
83
+ ]],
84
+ float roughness_texture_influence = 1.f [[
85
+ anno::display_name("Roughness Texture Influence"),
86
+ anno::in_group("Roughness"),
87
+ anno::hard_range(0.0f, 1.0f)
88
+ ]],
89
+ uniform texture_2d roughness_texture = texture_2d() [[
90
+ anno::description("The roughness texture"),
91
+ anno::display_name("Roughness Texture"),
92
+ anno::in_group("Roughness"),
93
+ anno::usage("roughness")
94
+ ]],
95
+ uniform texture_2d reflection_color_texture = texture_2d() [[
96
+ anno::description("The reflection color texture"),
97
+ anno::display_name("Reflection Color Texture"),
98
+ anno::in_group("Reflection")
99
+ ]],
100
+ uniform color reflection_color = color(1.f, 1.f, 1.f) [[
101
+ anno::display_name("Reflection Color"),
102
+ anno::in_group("Reflection")
103
+ ]],
104
+ uniform texture_2d normal_map_texture = texture_2d() [[
105
+ anno::description("The normal map texture"),
106
+ anno::display_name("Normal Map Texture"),
107
+ anno::in_group("Normal"),
108
+ anno::usage("normal")
109
+ ]],
110
+ uniform float normal_map_strength = 1.0 [[
111
+ anno::description("Determines the degree of bumpiness"),
112
+ anno::display_name("Normal Map Strength"),
113
+ anno::in_group("Normal"),
114
+ anno::usage(""),
115
+ anno::soft_range(0.f, 1.f)
116
+ ]],
117
+ uniform bool flip_tangent_u = false [[
118
+ anno::display_name("Normal Map Flip U Tangent"),
119
+ anno::in_group("Normal")
120
+ ]],
121
+ uniform bool flip_tangent_v = true [[
122
+ anno::display_name("Normal Map Flip V Tangent"),
123
+ anno::in_group("Normal")
124
+ ]],
125
+
126
+ // Cutout Opacity
127
+ uniform bool enable_opacity = false
128
+ [[
129
+ anno::display_name("Enable Opacity"),
130
+ anno::description("Enables the use of cutout opacity"),
131
+ anno::in_group("Opacity")
132
+ ]],
133
+ uniform float cutout_opacity = 1.0f [[
134
+ anno::hard_range(0.0, 1.0),
135
+ anno::display_name("Opacity Amount"),
136
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
137
+ anno::in_group("Opacity")
138
+ ]],
139
+ uniform texture_2d cutout_opacity_texture = texture_2d() [[
140
+ anno::description("The opacity map"),
141
+ anno::display_name("Opacity Map"),
142
+ anno::in_group("Opacity"),
143
+ anno::usage("opacity")
144
+ ]],
145
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha [[
146
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
147
+ anno::display_name("Opacity Mono Source"),
148
+ anno::in_group("Opacity"),
149
+ anno::usage("")
150
+ ]],
151
+ uniform float opacity_threshold = 0.f
152
+ [[
153
+ anno::hard_range(0.0, 1.0),
154
+ anno::display_name("Opacity Threshold"),
155
+ 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"),
156
+ anno::in_group("Opacity")
157
+ ]],
158
+
159
+ //
160
+ // End of new
161
+ //
162
+ // UV Projection Group
163
+ //
164
+ uniform bool project_uvw = false
165
+ [[
166
+ anno::display_name("Enable Project UVW Coordinates"),
167
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
168
+ anno::in_group("UV")
169
+ ]],
170
+ uniform bool world_or_object = false
171
+ [[
172
+ anno::display_name("Enable World Space"),
173
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
174
+ anno::in_group("UV")
175
+ ]],
176
+
177
+ // UV Space selector
178
+ uniform int uv_space_index = 0
179
+ [[
180
+ anno::display_name("UV Space Index"),
181
+ anno::description("Choose the UV Space Index to be used"),
182
+ anno::in_group("UV"),
183
+ anno::hard_range(0, 3)
184
+ ]],
185
+ uniform float2 texture_translate = float2(0.0f)
186
+ [[
187
+ anno::display_name("Texture Translate"),
188
+ anno::description("Controls the position of the texture."),
189
+ anno::in_group("UV")
190
+ ]],
191
+ uniform float texture_rotate = 0.f
192
+ [[
193
+ anno::display_name("Texture Rotate"),
194
+ anno::description("Rotates angle of the texture in degrees."),
195
+ anno::in_group("UV")
196
+ ]],
197
+ uniform float2 texture_scale = float2(1.0f)
198
+ [[
199
+ anno::display_name("Texture Tiling"),
200
+ anno::description("Controls repetition of the texture."),
201
+ anno::in_group("UV")
202
+ ]])
203
+ [[
204
+ anno::author("NVIDIA CORPORATION"),
205
+ anno::display_name("Omni Glass"),
206
+ anno::version( 1, 0, 0),
207
+ anno::in_group("Base"),
208
+ anno::description("Omni Glass Material V2"),
209
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
210
+ distill_off()
211
+ ]]
212
+ = OmniGlass_Opacity(
213
+ glass_color: glass_color,
214
+ glass_color_texture: glass_color_texture,
215
+ frosting_roughness: frosting_roughness,
216
+ glass_ior: glass_ior,
217
+ thin_walled: thin_walled,
218
+ depth: depth,
219
+ roughness_texture_influence: roughness_texture_influence,
220
+ roughness_texture: roughness_texture,
221
+ reflection_color_texture: reflection_color_texture,
222
+ reflection_color: reflection_color,
223
+ normal_map_texture: normal_map_texture,
224
+ normal_map_strength: normal_map_strength,
225
+ flip_tangent_u: flip_tangent_u,
226
+ flip_tangent_v: flip_tangent_v,
227
+ enable_opacity: enable_opacity,
228
+ cutout_opacity: cutout_opacity,
229
+ cutout_opacity_texture: cutout_opacity_texture,
230
+ cutout_opacity_mono_source: cutout_opacity_mono_source,
231
+ opacity_threshold: opacity_threshold,
232
+ project_uvw: project_uvw,
233
+ world_or_object: world_or_object,
234
+ uv_space_index: uv_space_index,
235
+ texture_translate: texture_translate,
236
+ texture_rotate: texture_rotate,
237
+ texture_scale: texture_scale
238
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_1.mdl ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.4;
30
+ import ::anno::*;
31
+ import ::base::*;
32
+
33
+ using OmniGlass_Opacity_1 import OmniGlass_Opacity;
34
+ export annotation distill_off();
35
+
36
+
37
+ export material OmniGlass
38
+ (
39
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
40
+ [[
41
+ anno::hidden(),
42
+ anno::unused()
43
+ ]],
44
+ uniform bool use_glass_color_texture = false
45
+ [[
46
+ anno::hidden(),
47
+ anno::unused()
48
+ ]],
49
+ uniform color glass_color = color(1.f, 1.f, 1.f)
50
+ [[
51
+ anno::display_name("Glass Color"),
52
+ anno::description("Sets the color of the glass"),
53
+ anno::hard_range(color(0.0), color(1.0)),
54
+ anno::in_group("Color")
55
+ ]],
56
+ uniform texture_2d glass_color_texture = texture_2d()
57
+ [[
58
+ anno::display_name("Glass Color Texture"),
59
+ anno::description("Specifies the texture to be used for the glass color of the material"),
60
+ anno::in_group("Color")
61
+ ]],
62
+ float frosting_roughness = 0.f
63
+ [[
64
+ anno::display_name("Glass Roughness"),
65
+ anno::description("Sets the roughness of the glass material "),
66
+ anno::hard_range(0.0, 1.0),
67
+ anno::in_group("Roughness")
68
+ ]],
69
+ uniform float glass_ior = 1.491f
70
+ [[
71
+ anno::display_name("Glass IOR"),
72
+ anno::description("Sets IOR of the glass material "),
73
+ anno::soft_range(1.0f, 4.0f),
74
+ anno::in_group("Refraction")
75
+ ]],
76
+ uniform bool thin_walled = false
77
+ [[
78
+ anno::display_name("Thin Walled"),
79
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
80
+ anno::in_group("Refraction")
81
+ ]],
82
+ uniform float depth = 0.001f
83
+ [[
84
+ anno::description("Controls how much light is absorbed through the surface"),
85
+ anno::display_name("Volume Absorption Scale"),
86
+ anno::in_group("Color"),
87
+ anno::soft_range(0.f, 1.f),
88
+ anno::hard_range(0.f, 1000.f)
89
+ ]],
90
+ float roughness_texture_influence = 1.f
91
+ [[
92
+ anno::display_name("Roughness Texture Influence"),
93
+ anno::in_group("Roughness"),
94
+ anno::hard_range(0.0f, 1.0f)
95
+ ]],
96
+ uniform texture_2d roughness_texture = texture_2d()
97
+ [[
98
+ anno::description("The roughness texture"),
99
+ anno::display_name("Roughness Texture"),
100
+ anno::in_group("Roughness"),
101
+ anno::usage("roughness")
102
+ ]],
103
+ uniform texture_2d reflection_color_texture = texture_2d()
104
+ [[
105
+ anno::description("The reflection color texture"),
106
+ anno::display_name("Reflection Color Texture"),
107
+ anno::in_group("Reflection")
108
+ ]],
109
+ uniform color reflection_color = color(1.f, 1.f, 1.f)
110
+ [[
111
+ anno::display_name("Reflection Color"),
112
+ anno::in_group("Reflection")
113
+ ]],
114
+ uniform texture_2d normal_map_texture = texture_2d()
115
+ [[
116
+ anno::description("The normal map texture"),
117
+ anno::display_name("Normal Map Texture"),
118
+ anno::in_group("Normal"),
119
+ anno::usage("normal")
120
+ ]],
121
+ uniform float normal_map_strength = 1.0
122
+ [[
123
+ anno::description("Determines the degree of bumpiness"),
124
+ anno::display_name("Normal Map Strength"),
125
+ anno::in_group("Normal"),
126
+ anno::usage(""),
127
+ anno::soft_range(0.f, 1.f)
128
+ ]],
129
+ uniform float geometry_normal_roughness_strength = 1.f
130
+ [[
131
+ anno::hard_range(0.f, 1.f),
132
+ anno::display_name("Normal map to roughness weight"),
133
+ anno::description("Enables and weights roughness induced by normal maps"),
134
+ anno::in_group("Normal")
135
+ ]],
136
+ uniform bool flip_tangent_u = false
137
+ [[
138
+ anno::display_name("Normal Map Flip U Tangent"),
139
+ anno::in_group("Normal")
140
+ ]],
141
+ uniform bool flip_tangent_v = true
142
+ [[
143
+ anno::display_name("Normal Map Flip V Tangent"),
144
+ anno::in_group("Normal")
145
+ ]],
146
+
147
+ // Cutout Opacity
148
+ uniform bool enable_opacity = false
149
+ [[
150
+ anno::display_name("Enable Opacity"),
151
+ anno::description("Enables the use of cutout opacity"),
152
+ anno::in_group("Opacity")
153
+ ]],
154
+ uniform float cutout_opacity = 1.0f
155
+ [[
156
+ anno::hard_range(0.0, 1.0),
157
+ anno::display_name("Opacity Amount"),
158
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
159
+ anno::in_group("Opacity")
160
+ ]],
161
+ uniform texture_2d cutout_opacity_texture = texture_2d()
162
+ [[
163
+ anno::description("The opacity map"),
164
+ anno::display_name("Opacity Map"),
165
+ anno::in_group("Opacity"),
166
+ anno::usage("opacity")
167
+ ]],
168
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha
169
+ [[
170
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
171
+ anno::display_name("Opacity Mono Source"),
172
+ anno::in_group("Opacity"),
173
+ anno::usage("")
174
+ ]],
175
+ uniform float opacity_threshold = 0.f
176
+ [[
177
+ anno::hard_range(0.0, 1.0),
178
+ anno::display_name("Opacity Threshold"),
179
+ 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"),
180
+ anno::in_group("Opacity")
181
+ ]],
182
+
183
+ // UV Projection Group
184
+ uniform bool project_uvw = false
185
+ [[
186
+ anno::display_name("Enable Project UVW Coordinates"),
187
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
188
+ anno::in_group("UV")
189
+ ]],
190
+ uniform bool world_or_object = false
191
+ [[
192
+ anno::display_name("Enable World Space"),
193
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
194
+ anno::in_group("UV")
195
+ ]],
196
+
197
+ // UV Space Selector
198
+ uniform int uv_space_index = 0
199
+ [[
200
+ anno::display_name("UV Space Index"),
201
+ anno::description("Choose the UV Space Index to be used"),
202
+ anno::in_group("UV"),
203
+ anno::hard_range(0, 3)
204
+ ]],
205
+ uniform float2 texture_translate = float2(0.0f)
206
+ [[
207
+ anno::display_name("Texture Translate"),
208
+ anno::description("Controls the position of the texture."),
209
+ anno::in_group("UV")
210
+ ]],
211
+ uniform float texture_rotate = 0.f
212
+ [[
213
+ anno::display_name("Texture Rotate"),
214
+ anno::description("Rotates angle of the texture in degrees."),
215
+ anno::in_group("UV")
216
+ ]],
217
+ uniform float2 texture_scale = float2(1.0f)
218
+ [[
219
+ anno::display_name("Texture Tiling"),
220
+ anno::description("Controls repetition of the texture."),
221
+ anno::in_group("UV")
222
+ ]]
223
+ )
224
+ [[
225
+ anno::author("NVIDIA CORPORATION"),
226
+ anno::display_name("Omni Glass"),
227
+ anno::version( 1, 0, 0),
228
+ anno::in_group("Base"),
229
+ anno::description("Omni Glass Material V2"),
230
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
231
+ distill_off()
232
+ ]]
233
+ = OmniGlass_Opacity(
234
+ glass_color: glass_color,
235
+ glass_color_texture: glass_color_texture,
236
+ frosting_roughness: frosting_roughness,
237
+ glass_ior: glass_ior,
238
+ thin_walled: thin_walled,
239
+ depth: depth,
240
+ roughness_texture_influence: roughness_texture_influence,
241
+ roughness_texture: roughness_texture,
242
+ reflection_color_texture: reflection_color_texture,
243
+ reflection_color: reflection_color,
244
+ normal_map_texture: normal_map_texture,
245
+ normal_map_strength: normal_map_strength,
246
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
247
+ flip_tangent_u: flip_tangent_u,
248
+ flip_tangent_v: flip_tangent_v,
249
+ enable_opacity: enable_opacity,
250
+ cutout_opacity: cutout_opacity,
251
+ cutout_opacity_texture: cutout_opacity_texture,
252
+ cutout_opacity_mono_source: cutout_opacity_mono_source,
253
+ opacity_threshold: opacity_threshold,
254
+ project_uvw: project_uvw,
255
+ world_or_object: world_or_object,
256
+ uv_space_index: uv_space_index,
257
+ texture_translate: texture_translate,
258
+ texture_rotate: texture_rotate,
259
+ texture_scale: texture_scale
260
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_Opacity.mdl ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+
30
+ mdl 1.4;
31
+
32
+ import ::tex::*;
33
+ import ::base::*;
34
+ import ::math::*;
35
+ import ::anno::*;
36
+ import ::df::*;
37
+ import ::state::*;
38
+
39
+ const string COPYRIGHT =
40
+ " Copyright 1986, 2020 NVIDIA Corporation. All rights reserved.\n"
41
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
42
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
43
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
44
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
45
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
46
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
47
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
48
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
49
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
50
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
51
+
52
+ float get_float( uniform texture_2d t,
53
+ float f,
54
+ base::texture_coordinate_info uvw,
55
+ uniform base::mono_mode mono_source = base::mono_maximum)
56
+ {
57
+ return tex::texture_isvalid(t)
58
+ ?
59
+ base::file_texture(t,
60
+ color(0.f, 0.f, 0.f),
61
+ color(1.f, 1.f, 1.f),
62
+ mono_source,
63
+ uvw,
64
+ float2(0.f, 1.f),
65
+ float2(0.f, 1.f),
66
+ tex::wrap_repeat,
67
+ tex::wrap_repeat,
68
+ false).mono
69
+ :
70
+ f;
71
+ }
72
+
73
+ color get_color( uniform texture_2d t,
74
+ color c,
75
+ base::texture_coordinate_info uvw)
76
+ {
77
+ return tex::texture_isvalid(t)
78
+ ?
79
+ base::file_texture(t,
80
+ color(0.f, 0.f, 0.f),
81
+ color(1.f, 1.f, 1.f),
82
+ base::mono_alpha,
83
+ uvw,
84
+ float2(0.f, 1.f),
85
+ float2(0.f, 1.f),
86
+ tex::wrap_repeat,
87
+ tex::wrap_repeat,
88
+ false).tint
89
+ :
90
+ c;
91
+ }
92
+
93
+ float apply_roughness_influence(
94
+ uniform texture_2d roughness_texture,
95
+ float constant_roughness,
96
+ float roughness_influence,
97
+ base::texture_coordinate_info uvw){
98
+ return math::lerp(constant_roughness, get_float(roughness_texture, constant_roughness, uvw), roughness_influence);
99
+ }
100
+
101
+ color get_volume_absorption(
102
+ float absorption = float(0.001f) [[
103
+ anno::display_name("Volume Absorption"),
104
+ anno::description("Controls how much light is absorbed through the surface"),
105
+ anno::hard_range(0.0,1000.0),
106
+ anno::soft_range(0.0,1.0)
107
+ ]],
108
+
109
+ color absorptionColor = color(1) [[
110
+ anno::display_name("Absorption Color"),
111
+ anno::description("Simulates shifts in color when light passes through the surface")
112
+ ]]
113
+ ) [[
114
+ anno::display_name("Absorption"),
115
+ anno::description("Provides an absorption coefficient for the volume"),
116
+ anno::unused()
117
+ ]] {
118
+ return (absorption > 0) ?
119
+ -math::log(math::clamp(absorptionColor, color(0), color(1))) * absorption * 100.0 :
120
+ color(0);
121
+ }
122
+
123
+ uniform float4x4 rotation_translation_scale(
124
+ uniform float3 rotation = float3(0.)
125
+ [[ anno::description("Rotation applied to every UVW coordinate") ]],
126
+ uniform float3 translation = float3(0.)
127
+ [[ anno::description("Offset applied to every UVW coordinate") ]],
128
+ uniform float3 scaling = float3(1.)
129
+ [[ anno::description("Scale applied to every UVW coordinate") ]]
130
+ )
131
+ [[
132
+ anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
133
+ anno::hidden()
134
+ ]]
135
+ {
136
+ float4x4 scale =
137
+ float4x4(scaling.x , 0. , 0. , 0.,
138
+ 0. , scaling.y , 0. , 0.,
139
+ 0. , 0. , scaling.z , 0.,
140
+ translation.x, translation.y, translation.z, 1.);
141
+
142
+ float3 s = math::sin(rotation);
143
+ float3 c = math::cos(rotation);
144
+ float4x4 rotate =
145
+ 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,
146
+ 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,
147
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
148
+ 0. , 0 , 0 , 1.);
149
+
150
+ return scale*rotate;
151
+ }
152
+
153
+
154
+
155
+
156
+
157
+ export annotation distill_off();
158
+
159
+ export material OmniGlass_Opacity(
160
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
161
+ [[
162
+ anno::hidden(),
163
+ anno::unused()
164
+ ]],
165
+ uniform bool use_glass_color_texture = false
166
+ [[
167
+ anno::hidden(),
168
+ anno::unused()
169
+ ]],
170
+ uniform color glass_color = color(1.f, 1.f, 1.f) [[
171
+ anno::display_name("Glass Color"),
172
+ anno::description("Sets the color of the glass"),
173
+ anno::hard_range(color(0.0), color(1.0)),
174
+ anno::in_group("Color")
175
+ ]],
176
+ uniform texture_2d glass_color_texture = texture_2d() [[
177
+ anno::display_name("Glass Color Texture"),
178
+ anno::description("Specifies the texture to be used for the glass color of the material"),
179
+ anno::in_group("Color")
180
+ ]],
181
+ float frosting_roughness = 0.f [[
182
+ anno::display_name("Glass Roughness"),
183
+ anno::description("Sets the roughness of the glass material "),
184
+ anno::hard_range(0.0, 1.0),
185
+ anno::in_group("Roughness")
186
+ ]],
187
+ uniform float glass_ior = 1.491f [[
188
+ anno::display_name("Glass IOR"),
189
+ anno::description("Sets IOR of the glass material "),
190
+ anno::soft_range(1.0f, 4.0f),
191
+ anno::in_group("Refraction")
192
+ ]],
193
+ uniform bool thin_walled = false [[
194
+ anno::display_name("Thin Walled"),
195
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
196
+ anno::in_group("Refraction")
197
+ ]],
198
+
199
+
200
+ // NEW PARAMETERS
201
+ uniform float depth = 0.001f [[
202
+ anno::description("Controls how much light is absorbed through the surface"),
203
+ anno::display_name("Volume Absorption Scale"),
204
+ anno::in_group("Color"),
205
+ anno::soft_range(0.f, 1.f),
206
+ anno::hard_range(0.f, 1000.f)
207
+ ]],
208
+ float roughness_texture_influence = 1.f [[
209
+ anno::display_name("Roughness Texture Influence"),
210
+ anno::in_group("Roughness"),
211
+ anno::hard_range(0.0f, 1.0f)
212
+ ]],
213
+ uniform texture_2d roughness_texture = texture_2d() [[
214
+ anno::description("The roughness texture"),
215
+ anno::display_name("Roughness Texture"),
216
+ anno::in_group("Roughness"),
217
+ anno::usage("")
218
+ ]],
219
+ uniform texture_2d reflection_color_texture = texture_2d() [[
220
+ anno::description("The reflection color texture"),
221
+ anno::display_name("Reflection Color Texture"),
222
+ anno::in_group("Reflection")
223
+ ]],
224
+ uniform color reflection_color = color(1.f, 1.f, 1.f) [[
225
+ anno::display_name("Reflection Color"),
226
+ anno::in_group("Reflection")
227
+ ]],
228
+ uniform texture_2d normal_map_texture = texture_2d() [[
229
+ anno::description("The normal map texture"),
230
+ anno::display_name("Normal Map Texture"),
231
+ anno::in_group("Normal"),
232
+ anno::usage("")
233
+ ]],
234
+ uniform float normal_map_strength = 1.0 [[
235
+ anno::description("Determines the degree of bumpiness"),
236
+ anno::display_name("Normal Map Strength"),
237
+ anno::in_group("Normal"),
238
+ anno::usage(""),
239
+ anno::soft_range(0.f, 1.f)
240
+ ]],
241
+ uniform bool flip_tangent_u = false [[
242
+ anno::display_name("Normal Map Flip U Tangent"),
243
+ anno::in_group("Normal")
244
+ ]],
245
+ uniform bool flip_tangent_v = true [[
246
+ anno::display_name("Normal Map Flip V Tangent"),
247
+ anno::in_group("Normal")
248
+ ]],
249
+
250
+ // Cutout Opacity
251
+ uniform bool enable_opacity = true
252
+ [[
253
+ anno::display_name("Enable Opacity"),
254
+ anno::description("Enables the use of cutout opacity"),
255
+ anno::in_group("Opacity")
256
+ ]],
257
+ uniform float cutout_opacity = 1.0f [[
258
+ anno::hard_range(0.0, 1.0),
259
+ anno::display_name("Opacity Amount"),
260
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
261
+ anno::in_group("Opacity")
262
+ ]],
263
+ uniform texture_2d cutout_opacity_texture = texture_2d() [[
264
+ anno::description("The opacity map"),
265
+ anno::display_name("Opacity Map"),
266
+ anno::in_group("Opacity")
267
+ ]],
268
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha [[
269
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
270
+ anno::display_name("Opacity Mono Source"),
271
+ anno::in_group("Opacity"),
272
+ anno::usage("")
273
+ ]],
274
+ uniform float opacity_threshold = 0.f
275
+ [[
276
+ anno::hard_range(0.0, 1.0),
277
+ anno::display_name("Opacity Threshold"),
278
+ 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"),
279
+ anno::in_group("Opacity")
280
+ ]],
281
+
282
+ //
283
+ // End of new
284
+ //
285
+ // UV Projection Group
286
+ //
287
+ uniform bool project_uvw = false
288
+ [[
289
+ anno::display_name("Enable Project UVW Coordinates"),
290
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
291
+ anno::in_group("UV")
292
+ ]],
293
+ uniform bool world_or_object = false
294
+ [[
295
+ anno::display_name("Enable World Space"),
296
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
297
+ anno::in_group("UV")
298
+ ]],
299
+
300
+ // UV Space selector
301
+ uniform int uv_space_index = 0
302
+ [[
303
+ anno::display_name("UV Space Index"),
304
+ anno::description("Choose the UV Space Index to be used"),
305
+ anno::in_group("UV"),
306
+ anno::hard_range(0, 3)
307
+ ]],
308
+ uniform float2 texture_translate = float2(0.0f)
309
+ [[
310
+ anno::display_name("Texture Translate"),
311
+ anno::description("Controls the position of the texture."),
312
+ anno::in_group("UV")
313
+ ]],
314
+ uniform float texture_rotate = 0.f
315
+ [[
316
+ anno::display_name("Texture Rotate"),
317
+ anno::description("Rotates angle of the texture in degrees."),
318
+ anno::in_group("UV")
319
+ ]],
320
+ uniform float2 texture_scale = float2(1.0f)
321
+ [[
322
+ anno::display_name("Texture Scale"),
323
+ anno::description("Larger numbers increase the size."),
324
+ anno::in_group("UV")
325
+ ]])
326
+ [[
327
+ anno::copyright_notice(COPYRIGHT),
328
+ anno::author("NVIDIA CORPORATION"),
329
+ anno::display_name("Omni Glass Opacity"),
330
+ anno::version( 1, 0, 0),
331
+ anno::description("Omni Glass Opacity Material"),
332
+ anno::in_group("Base"),
333
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
334
+ distill_off()
335
+ ]]
336
+ =
337
+ let {
338
+ /* Material Properties */
339
+
340
+ bool local_thin_walled = (tex::texture_isvalid(cutout_opacity_texture) || cutout_opacity != 1.f) ?
341
+ true : thin_walled;
342
+
343
+ color local_glass_ior = glass_ior;
344
+
345
+ /* UVW Properties */
346
+ // Generating the texture coordinates for the texture lookups
347
+ base::texture_coordinate_system the_system = world_or_object ?
348
+ base::texture_coordinate_world :
349
+ base::texture_coordinate_object;
350
+
351
+
352
+ base::texture_coordinate_info uvw = project_uvw ?
353
+ base::coordinate_projection(
354
+ coordinate_system: the_system,
355
+ texture_space: uv_space_index,
356
+ projection_type: base::projection_cubic ) :
357
+ base::coordinate_source(
358
+ coordinate_system: base::texture_coordinate_uvw,
359
+ texture_space: uv_space_index
360
+ );
361
+
362
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
363
+ transform: rotation_translation_scale(
364
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
365
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
366
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
367
+ ),
368
+ coordinate: uvw
369
+ );
370
+ float opacity_value = get_float(
371
+ cutout_opacity_texture,
372
+ cutout_opacity,
373
+ transformed_uvw,
374
+ cutout_opacity_mono_source
375
+ );
376
+
377
+ // The opacity_threshold is interpreted as follows:
378
+ // 1. opacity_threshold > 0: binary opacity masking mode
379
+ // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0
380
+ // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched,
381
+ // allowing the renderer to use fractional cutout_opacity values, if it supports this feature
382
+ //
383
+ // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets
384
+ // cutout_opacity values of 1.0 as opaque and anything below as fully transparent
385
+ float local_cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
386
+
387
+ color local_reflection_color = get_color(
388
+ reflection_color_texture,
389
+ reflection_color,
390
+ transformed_uvw
391
+ );
392
+
393
+ color local_transmission_color = get_color(
394
+ glass_color_texture,
395
+ glass_color,
396
+ transformed_uvw
397
+ );
398
+
399
+ /* Surface Properties */
400
+ float local_roughness = apply_roughness_influence(
401
+ roughness_texture,
402
+ frosting_roughness,
403
+ roughness_texture_influence,
404
+ transformed_uvw
405
+ );
406
+
407
+ float local_roughness_squared = local_roughness * local_roughness;
408
+ bsdf ggx_1 = ::df::microfacet_ggx_smith_bsdf(
409
+ local_roughness_squared,
410
+ local_roughness_squared,
411
+ local_reflection_color,
412
+ ::state::texture_tangent_u(0),
413
+ ::df::scatter_reflect,
414
+ ""
415
+ );
416
+
417
+ bsdf ggx_2 = ::df::microfacet_ggx_smith_bsdf(
418
+ local_roughness_squared,
419
+ local_roughness_squared,
420
+ local_transmission_color,
421
+ ::state::texture_tangent_u(0),
422
+ ::df::scatter_transmit,
423
+ ""
424
+ );
425
+
426
+ material_surface local_surface(
427
+ ::df::fresnel_layer(
428
+ glass_ior,
429
+ 1.f,
430
+ ggx_1,
431
+ ggx_2,
432
+ normal: ::state::normal()
433
+ ),
434
+ material_emission()
435
+ );
436
+
437
+ /* Volume Properties */
438
+ color local_volume_absorption = depth;
439
+ color local_volume_scattering = color(0.f, 0.f, 0.f);
440
+ material_volume local_volume(
441
+ vdf(),
442
+ local_volume_absorption,
443
+ local_volume_scattering
444
+ );
445
+
446
+ // Normal calculations
447
+ float3 the_normal = tex::texture_isvalid(normal_map_texture) ?
448
+ base::tangent_space_normal_texture(
449
+ texture: normal_map_texture,
450
+ factor: normal_map_strength,
451
+ flip_tangent_u: flip_tangent_u,
452
+ flip_tangent_v: flip_tangent_v,
453
+ uvw: transformed_uvw
454
+ //flip_tangent_v: true
455
+ ): state::normal() ;
456
+
457
+ /* Geometry Properties */
458
+
459
+ material_geometry local_geometry(
460
+ float3(0.f),
461
+ local_cutout_opacity,
462
+ the_normal
463
+ );
464
+ /* material_geometry local_geometry(
465
+ float3(0.f),
466
+ local_cutout_opacity,
467
+ ::base::tangent_space_normal_texture(
468
+ normal_map_texture,
469
+ normal_map_strength,
470
+ false,
471
+ true, /*flip_tangent_v OM-22707*/
472
+ transformed_uvw,
473
+ float2(0.f, 1.f),
474
+ float2(0.f, 1.f),
475
+ ::tex::wrap_repeat,
476
+ ::tex::wrap_repeat,
477
+ false,
478
+ 1.f,
479
+ 0.f)
480
+ ); */
481
+
482
+ } in
483
+ material(
484
+ thin_walled: local_thin_walled,
485
+ surface: local_surface,
486
+ ior: local_glass_ior,
487
+ volume: local_volume,
488
+ geometry: local_geometry);
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniGlass_Opacity_1.mdl ADDED
@@ -0,0 +1,487 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+
30
+ mdl 1.4;
31
+
32
+ import ::tex::*;
33
+ import ::base::*;
34
+ import ::math::*;
35
+ import ::anno::*;
36
+ import ::df::*;
37
+ import ::state::*;
38
+ import OmniPBRBase::*;
39
+
40
+ const string COPYRIGHT =
41
+ " Copyright 1986, 2020 NVIDIA Corporation. All rights reserved.\n"
42
+ " MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
43
+ " WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
44
+ " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
45
+ " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
46
+ " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
47
+ " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
48
+ " CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
49
+ " GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
50
+ " AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
51
+ " INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
52
+
53
+ export annotation distill_off();
54
+
55
+
56
+ float get_float(
57
+ uniform texture_2d t,
58
+ float f,
59
+ base::texture_coordinate_info uvw,
60
+ uniform base::mono_mode mono_source = base::mono_maximum
61
+ )
62
+ {
63
+ return tex::texture_isvalid(t) ?
64
+ base::file_texture(
65
+ t,
66
+ color(0.f, 0.f, 0.f),
67
+ color(1.f, 1.f, 1.f),
68
+ mono_source,
69
+ uvw,
70
+ float2(0.f, 1.f),
71
+ float2(0.f, 1.f),
72
+ tex::wrap_repeat,
73
+ tex::wrap_repeat,
74
+ false
75
+ ).mono :
76
+ f;
77
+ }
78
+
79
+ color get_color(
80
+ uniform texture_2d t,
81
+ color c,
82
+ base::texture_coordinate_info uvw
83
+ )
84
+ {
85
+ return tex::texture_isvalid(t) ?
86
+ base::file_texture(
87
+ t,
88
+ color(0.f, 0.f, 0.f),
89
+ color(1.f, 1.f, 1.f),
90
+ base::mono_alpha,
91
+ uvw,
92
+ float2(0.f, 1.f),
93
+ float2(0.f, 1.f),
94
+ tex::wrap_repeat,
95
+ tex::wrap_repeat,
96
+ false
97
+ ).tint :
98
+ c;
99
+ }
100
+
101
+ float apply_roughness_influence(
102
+ uniform texture_2d roughness_texture,
103
+ float constant_roughness,
104
+ float roughness_influence,
105
+ base::texture_coordinate_info uvw
106
+ )
107
+ {
108
+ return math::lerp(
109
+ constant_roughness,
110
+ get_float(roughness_texture, constant_roughness, uvw),
111
+ roughness_influence
112
+ );
113
+ }
114
+
115
+ uniform float4x4 rotation_translation_scale(
116
+ uniform float3 rotation = float3(0.)
117
+ [[
118
+ anno::description("Rotation applied to every UVW coordinate")
119
+ ]],
120
+ uniform float3 translation = float3(0.)
121
+ [[
122
+ anno::description("Offset applied to every UVW coordinate")
123
+ ]],
124
+ uniform float3 scaling = float3(1.)
125
+ [[
126
+ anno::description("Scale applied to every UVW coordinate")
127
+ ]]
128
+ )
129
+ [[
130
+ anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
131
+ anno::hidden()
132
+ ]]
133
+ {
134
+ float4x4 scale = float4x4(
135
+ scaling.x , 0. , 0. , 0.,
136
+ 0. , scaling.y , 0. , 0.,
137
+ 0. , 0. , scaling.z , 0.,
138
+ translation.x, translation.y, translation.z, 1.
139
+ );
140
+
141
+ float3 s = math::sin(rotation);
142
+ float3 c = math::cos(rotation);
143
+ float4x4 rotate = float4x4(
144
+ 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,
145
+ 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,
146
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
147
+ 0. , 0. , 0. , 1.
148
+ );
149
+
150
+ return scale*rotate;
151
+ }
152
+
153
+
154
+ export material OmniGlass_Opacity
155
+ (
156
+ color absorption_coeff = color(0.f, 0.f, 0.f) // hiding this parameter as it does not exist in the new material
157
+ [[
158
+ anno::hidden(),
159
+ anno::unused()
160
+ ]],
161
+ uniform bool use_glass_color_texture = false
162
+ [[
163
+ anno::hidden(),
164
+ anno::unused()
165
+ ]],
166
+ uniform color glass_color = color(1.f, 1.f, 1.f)
167
+ [[
168
+ anno::display_name("Glass Color"),
169
+ anno::description("Sets the color of the glass"),
170
+ anno::hard_range(color(0.0), color(1.0)),
171
+ anno::in_group("Color")
172
+ ]],
173
+ uniform texture_2d glass_color_texture = texture_2d()
174
+ [[
175
+ anno::display_name("Glass Color Texture"),
176
+ anno::description("Specifies the texture to be used for the glass color of the material"),
177
+ anno::in_group("Color")
178
+ ]],
179
+ float frosting_roughness = 0.f
180
+ [[
181
+ anno::display_name("Glass Roughness"),
182
+ anno::description("Sets the roughness of the glass material "),
183
+ anno::hard_range(0.0, 1.0),
184
+ anno::in_group("Roughness")
185
+ ]],
186
+ uniform float glass_ior = 1.491f
187
+ [[
188
+ anno::display_name("Glass IOR"),
189
+ anno::description("Sets IOR of the glass material "),
190
+ anno::soft_range(1.0f, 4.0f),
191
+ anno::in_group("Refraction")
192
+ ]],
193
+ uniform bool thin_walled = false
194
+ [[
195
+ anno::display_name("Thin Walled"),
196
+ anno::description("When enabled, the material is considered thin-walled. Use this, when you have glass surfaces that are modeled with a single plane"),
197
+ anno::in_group("Refraction")
198
+ ]],
199
+ uniform float depth = 0.001f
200
+ [[
201
+ anno::description("Controls how much light is absorbed through the surface"),
202
+ anno::display_name("Volume Absorption Scale"),
203
+ anno::in_group("Color"),
204
+ anno::soft_range(0.f, 1.f),
205
+ anno::hard_range(0.f, 1000.f)
206
+ ]],
207
+ float roughness_texture_influence = 1.f
208
+ [[
209
+ anno::display_name("Roughness Texture Influence"),
210
+ anno::in_group("Roughness"),
211
+ anno::hard_range(0.0f, 1.0f)
212
+ ]],
213
+ uniform texture_2d roughness_texture = texture_2d()
214
+ [[
215
+ anno::description("The roughness texture"),
216
+ anno::display_name("Roughness Texture"),
217
+ anno::in_group("Roughness"),
218
+ anno::usage("")
219
+ ]],
220
+ uniform texture_2d reflection_color_texture = texture_2d()
221
+ [[
222
+ anno::description("The reflection color texture"),
223
+ anno::display_name("Reflection Color Texture"),
224
+ anno::in_group("Reflection")
225
+ ]],
226
+ uniform color reflection_color = color(1.f, 1.f, 1.f)
227
+ [[
228
+ anno::display_name("Reflection Color"),
229
+ anno::in_group("Reflection")
230
+ ]],
231
+ uniform texture_2d normal_map_texture = texture_2d()
232
+ [[
233
+ anno::description("The normal map texture"),
234
+ anno::display_name("Normal Map Texture"),
235
+ anno::in_group("Normal"),
236
+ anno::usage("")
237
+ ]],
238
+ uniform float normal_map_strength = 1.0
239
+ [[
240
+ anno::description("Determines the degree of bumpiness"),
241
+ anno::display_name("Normal Map Strength"),
242
+ anno::in_group("Normal"),
243
+ anno::usage(""),
244
+ anno::soft_range(0.f, 1.f)
245
+ ]],
246
+ uniform float geometry_normal_roughness_strength = 1.f
247
+ [[
248
+ anno::hard_range(0.f, 1.f),
249
+ anno::display_name("Normal map to roughness weight"),
250
+ anno::description("Enables and weights roughness induced by normal maps"),
251
+ anno::in_group("Normal")
252
+ ]],
253
+ uniform bool flip_tangent_u = false
254
+ [[
255
+ anno::display_name("Normal Map Flip U Tangent"),
256
+ anno::in_group("Normal")
257
+ ]],
258
+ uniform bool flip_tangent_v = true
259
+ [[
260
+ anno::display_name("Normal Map Flip V Tangent"),
261
+ anno::in_group("Normal")
262
+ ]],
263
+
264
+ // Cutout Opacity
265
+ uniform bool enable_opacity = true
266
+ [[
267
+ anno::display_name("Enable Opacity"),
268
+ anno::description("Enables the use of cutout opacity"),
269
+ anno::in_group("Opacity")
270
+ ]],
271
+ uniform float cutout_opacity = 1.0f
272
+ [[
273
+ anno::hard_range(0.0, 1.0),
274
+ anno::display_name("Opacity Amount"),
275
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
276
+ anno::in_group("Opacity")
277
+ ]],
278
+ uniform texture_2d cutout_opacity_texture = texture_2d()
279
+ [[
280
+ anno::description("The opacity map"),
281
+ anno::display_name("Opacity Map"),
282
+ anno::in_group("Opacity")
283
+ ]],
284
+ uniform base::mono_mode cutout_opacity_mono_source = base::mono_alpha
285
+ [[
286
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
287
+ anno::display_name("Opacity Mono Source"),
288
+ anno::in_group("Opacity"),
289
+ anno::usage("")
290
+ ]],
291
+ uniform float opacity_threshold = 0.f
292
+ [[
293
+ anno::hard_range(0.0, 1.0),
294
+ anno::display_name("Opacity Threshold"),
295
+ 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"),
296
+ anno::in_group("Opacity")
297
+ ]],
298
+
299
+ // UV Projection Group
300
+ uniform bool project_uvw = false
301
+ [[
302
+ anno::display_name("Enable Project UVW Coordinates"),
303
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
304
+ anno::in_group("UV")
305
+ ]],
306
+ uniform bool world_or_object = false
307
+ [[
308
+ anno::display_name("Enable World Space"),
309
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
310
+ anno::in_group("UV")
311
+ ]],
312
+
313
+ // UV Space Selector
314
+ uniform int uv_space_index = 0
315
+ [[
316
+ anno::display_name("UV Space Index"),
317
+ anno::description("Choose the UV Space Index to be used"),
318
+ anno::in_group("UV"),
319
+ anno::hard_range(0, 3)
320
+ ]],
321
+ uniform float2 texture_translate = float2(0.0f)
322
+ [[
323
+ anno::display_name("Texture Translate"),
324
+ anno::description("Controls the position of the texture."),
325
+ anno::in_group("UV")
326
+ ]],
327
+ uniform float texture_rotate = 0.f
328
+ [[
329
+ anno::display_name("Texture Rotate"),
330
+ anno::description("Rotates angle of the texture in degrees."),
331
+ anno::in_group("UV")
332
+ ]],
333
+ uniform float2 texture_scale = float2(1.0f)
334
+ [[
335
+ anno::display_name("Texture Scale"),
336
+ anno::description("Larger numbers increase the size."),
337
+ anno::in_group("UV")
338
+ ]]
339
+ )
340
+ [[
341
+ anno::copyright_notice(COPYRIGHT),
342
+ anno::author("NVIDIA CORPORATION"),
343
+ anno::display_name("Omni Glass Opacity"),
344
+ anno::version( 1, 0, 0),
345
+ anno::description("Omni Glass Opacity Material"),
346
+ anno::in_group("Base"),
347
+ anno::key_words(string[]("omni", "omniverse", "glass", "transparent", "window", "transparency", "workflow")),
348
+ distill_off()
349
+ ]]
350
+ = let {
351
+ // Material Properties
352
+ bool local_thin_walled = (tex::texture_isvalid(cutout_opacity_texture) || cutout_opacity != 1.f) ? true : thin_walled;
353
+ color local_glass_ior = glass_ior;
354
+
355
+
356
+ // UVW Properties
357
+ // Generating the texture coordinates for the texture lookups
358
+ base::texture_coordinate_system the_system = world_or_object ?
359
+ base::texture_coordinate_world :
360
+ base::texture_coordinate_object;
361
+
362
+ base::texture_coordinate_info uvw = project_uvw ?
363
+ base::coordinate_projection(
364
+ coordinate_system: the_system,
365
+ texture_space: uv_space_index,
366
+ projection_type: base::projection_cubic
367
+ ) :
368
+ base::coordinate_source(
369
+ coordinate_system: base::texture_coordinate_uvw,
370
+ texture_space: uv_space_index
371
+ );
372
+
373
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
374
+ transform: rotation_translation_scale(
375
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
376
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI),
377
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
378
+ ),
379
+ coordinate: uvw
380
+ );
381
+
382
+
383
+ // Opacity Properties
384
+ float opacity_value = get_float(cutout_opacity_texture, cutout_opacity, transformed_uvw, cutout_opacity_mono_source);
385
+
386
+ // The opacity_threshold is interpreted as follows:
387
+ // 1. opacity_threshold > 0: binary opacity masking mode
388
+ // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0
389
+ // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched,
390
+ // allowing the renderer to use fractional cutout_opacity values, if it supports this feature
391
+ //
392
+ // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets
393
+ // cutout_opacity values of 1.0 as opaque and anything below as fully transparent
394
+ float local_cutout_opacity = enable_opacity ?
395
+ ((opacity_threshold == 0.0) ?
396
+ opacity_value :
397
+ ((opacity_value >= opacity_threshold) ? 1.0 : 0)
398
+ ) :
399
+ 1.0;
400
+
401
+
402
+ // Surface Properties
403
+ color local_reflection_color = get_color(reflection_color_texture, reflection_color, transformed_uvw);
404
+ color local_transmission_color = get_color(glass_color_texture, glass_color, transformed_uvw);
405
+
406
+ OmniPBRBase::NormalData defaultData(state::normal(), float2(0.f));
407
+ OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normal_map_texture) ?
408
+ OmniPBRBase::tangent_space_normal_roughness_texture(
409
+ normal_map_texture,
410
+ normal_map_strength,
411
+ flip_tangent_u,
412
+ flip_tangent_v,
413
+ transformed_uvw,
414
+ float2(0.f, 1.f),
415
+ float2(0.f, 1.f),
416
+ tex::wrap_repeat,
417
+ tex::wrap_repeat,
418
+ false,
419
+ 1.f,
420
+ 0.f,
421
+ 0.f,
422
+ int2(0),
423
+ tex::wrap_repeat,
424
+ 30.f
425
+ ) :
426
+ defaultData;
427
+
428
+ float local_roughness = apply_roughness_influence(
429
+ roughness_texture,
430
+ frosting_roughness,
431
+ roughness_texture_influence,
432
+ transformed_uvw
433
+ );
434
+ float2 local_roughness_squared(
435
+ (local_roughness * local_roughness +
436
+ geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x),
437
+ (local_roughness * local_roughness +
438
+ geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y)
439
+ );
440
+
441
+ float3 the_normal = normal_data.normal;
442
+
443
+ bsdf ggx_1 = ::df::microfacet_ggx_smith_bsdf(
444
+ roughness_u: local_roughness_squared.x,
445
+ roughness_v: local_roughness_squared.y,
446
+ tint: local_reflection_color,
447
+ tangent_u: ::state::texture_tangent_u(0),
448
+ mode: ::df::scatter_reflect
449
+ );
450
+
451
+ bsdf ggx_2 = ::df::microfacet_ggx_smith_bsdf(
452
+ roughness_u: local_roughness_squared.x,
453
+ roughness_v: local_roughness_squared.y,
454
+ tint: local_transmission_color,
455
+ tangent_u: ::state::texture_tangent_u(0),
456
+ mode: ::df::scatter_transmit
457
+ );
458
+
459
+ material_surface local_surface(
460
+ ::df::fresnel_layer(
461
+ ior: glass_ior,
462
+ weight: 1.f,
463
+ layer: ggx_1,
464
+ base: ggx_2,
465
+ normal: the_normal
466
+ ),
467
+ material_emission()
468
+ );
469
+
470
+
471
+ // Volume Properties
472
+ color local_volume_absorption = depth;
473
+ color local_volume_scattering = color(0.f, 0.f, 0.f);
474
+
475
+ material_volume local_volume(vdf(), local_volume_absorption, local_volume_scattering);
476
+
477
+
478
+ // Geometry Properties
479
+ material_geometry local_geometry(float3(0.f), local_cutout_opacity, the_normal);
480
+
481
+ } in material(
482
+ thin_walled: local_thin_walled,
483
+ surface: local_surface,
484
+ ior: local_glass_ior,
485
+ volume: local_volume,
486
+ geometry: local_geometry
487
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR.mdl ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::anno::*;
38
+
39
+ import ::debug::*;
40
+
41
+ import ::nvidia::core_definitions::file_texture;
42
+ import ::nvidia::core_definitions::normalmap_texture;
43
+
44
+ import OmniPBR_ClearCoat::*;
45
+
46
+
47
+ // OmniPBR //
48
+
49
+ export material OmniPBR(
50
+
51
+ // Albdeo //
52
+
53
+ color diffuse_color_constant = color(0.2) [[
54
+ anno::display_name("Albedo Color"),
55
+ anno::description("This is the albedo base color"),
56
+ anno::in_group("Albedo")
57
+ ]],
58
+ uniform texture_2d diffuse_texture = texture_2d() [[
59
+ anno::display_name("Albedo Map"),
60
+ anno::in_group("Albedo")
61
+ ]],
62
+ float albedo_desaturation = float(0.0) [[
63
+ anno::display_name("Albedo Desaturation"),
64
+ anno::description("Desaturates the diffuse color"),
65
+ anno::in_group("Albedo"),
66
+ anno::soft_range(float(0.0), float(1.0))
67
+ ]],
68
+ float albedo_add = float(0.0) [[
69
+ anno::display_name("Albedo Add"),
70
+ anno::description("Adds a constant value to the diffuse color "),
71
+ anno::in_group("Albedo"),
72
+ anno::soft_range(float(-1.0), float(1.0))
73
+ ]],
74
+ float albedo_brightness = float(1.0) [[
75
+ anno::display_name("Albedo Brightness"),
76
+ anno::description("Multiplier for the diffuse color "),
77
+ anno::in_group("Albedo"),
78
+ anno::soft_range(float(0.0), float(1.0))
79
+ ]],
80
+ color diffuse_tint = color(1.0) [[
81
+ anno::display_name("Color Tint"),
82
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
83
+ anno::in_group("Albedo")
84
+ ]],
85
+
86
+
87
+ // Reflectivity //
88
+
89
+ float reflection_roughness_constant = float(0.5) [[
90
+ anno::display_name("Roughness Amount"),
91
+ anno::description("Higher roughness values lead to more blurry reflections"),
92
+ anno::in_group("Reflectivity"),
93
+ anno::hard_range(float(0.0), float(1.0))
94
+ ]],
95
+ float reflection_roughness_texture_influence = float(0.0) [[
96
+ anno::display_name("Roughness Map Influence"),
97
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
98
+ anno::in_group("Reflectivity"),
99
+ anno::hard_range(float(0.0), float(1.0))
100
+ ]],
101
+ uniform texture_2d reflectionroughness_texture = texture_2d() [[
102
+ anno::display_name("Roughness Map"),
103
+ anno::in_group("Reflectivity"),
104
+ anno::usage("roughness")
105
+ ]],
106
+ float metallic_constant = float(0.0) [[
107
+ anno::display_name("Metallic Amount"),
108
+ anno::description("Metallic Material"),
109
+ anno::in_group("Reflectivity"),
110
+ anno::hard_range(float(0.0), float(1.0))
111
+ ]],
112
+ float metallic_texture_influence = float(0.0) [[
113
+ anno::display_name("Metallic Map Influence"),
114
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
115
+ anno::in_group("Reflectivity"),
116
+ anno::hard_range(float(0.0), float(1.0))
117
+ ]],
118
+ uniform texture_2d metallic_texture = texture_2d() [[
119
+ anno::display_name("Metallic Map"),
120
+ anno::in_group("Reflectivity"),
121
+ anno::usage("metalness")
122
+ ]],
123
+ float specular_level = float(0.5) [[
124
+ anno::display_name("Specular"),
125
+ anno::description("The specular level (intensity) of the material"),
126
+ anno::in_group("Reflectivity"),
127
+ anno::soft_range(float(0.0), float(1.0))
128
+ ]],
129
+
130
+
131
+ // ORM //
132
+
133
+ uniform bool enable_ORM_texture = false [[
134
+ anno::display_name("Enable ORM Texture"),
135
+ anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
136
+ anno::in_group("Reflectivity")
137
+ ]],
138
+ uniform texture_2d ORM_texture = texture_2d() [[
139
+ anno::display_name("ORM Map"),
140
+ anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
141
+ anno::in_group("Reflectivity"),
142
+ anno::usage("roughness")
143
+ ]],
144
+
145
+
146
+ // AO Group //
147
+
148
+ float ao_to_diffuse = 0.0 [[
149
+ anno::display_name("AO to diffuse"),
150
+ anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
151
+ anno::in_group("AO"),
152
+ anno::hard_range(float(0.0), float(1.0))
153
+ ]],
154
+ uniform texture_2d ao_texture = texture_2d() [[
155
+ anno::display_name("Ambient Occlusion Map"),
156
+ anno::description("The ambient occlusion texture for the material"),
157
+ anno::in_group("AO"),
158
+ anno::usage("occlusion")
159
+ ]],
160
+
161
+
162
+ // Emission //
163
+
164
+ uniform bool enable_emission = false [[
165
+ anno::display_name("Enable Emission"),
166
+ anno::description("Enables the emission of light from the material"),
167
+ anno::in_group("Emissive")
168
+ ]],
169
+ color emissive_color = color(1.0,0.1,0.1) [[
170
+ anno::display_name("Emissive Color"),
171
+ anno::description("The emission color"),
172
+ anno::in_group("Emissive"),
173
+ anno::enable_if("enable_emission == true")
174
+ ]],
175
+ uniform texture_2d emissive_color_texture = texture_2d() [[
176
+ anno::display_name("Emissive Color map"),
177
+ anno::in_group("Emissive"),
178
+ anno::description("The emissive color texture"),
179
+ anno::enable_if("enable_emission == true")
180
+ ]],
181
+ uniform texture_2d emissive_mask_texture = texture_2d() [[
182
+ anno::display_name("Emissive Mask map"),
183
+ anno::description("The texture masking the emissive color"),
184
+ anno::in_group("Emissive"),
185
+ anno::enable_if("enable_emission == true"),
186
+ anno::usage("occlusion")
187
+ ]],
188
+ float emissive_intensity = float(40.0) [[
189
+ anno::display_name("Emissive Intensity"),
190
+ anno::description("Intensity of the emission"),
191
+ anno::in_group("Emissive"),
192
+ anno::enable_if("enable_emission == true")
193
+ ]],
194
+
195
+
196
+ // Cutout Opacity //
197
+
198
+ uniform bool enable_opacity = false [[
199
+ anno::display_name("Enable Opacity"),
200
+ anno::description("Enables the use of cutout opacity"),
201
+ anno::in_group("Opacity")
202
+ ]],
203
+ uniform texture_2d opacity_texture = texture_2d() [[
204
+ anno::display_name("Opacity Map"),
205
+ anno::in_group("Opacity"),
206
+ anno::usage("opacity")
207
+ ]],
208
+ float opacity_constant = float(1.0) [[
209
+ anno::display_name("Opacity Amount"),
210
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
211
+ anno::in_group("Opacity"),
212
+ anno::hard_range(float(0.0), float(1.0))
213
+ ]],
214
+ uniform bool enable_opacity_texture = false [[
215
+ anno::display_name("Enable Opacity Texture"),
216
+ anno::description("Enables or disables the usage of the opacity texture map"),
217
+ anno::in_group("Opacity")
218
+ ]],
219
+ uniform base::mono_mode opacity_mode = base::mono_average [[
220
+ anno::display_name("Opacity Mono Source"),
221
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
222
+ anno::in_group("Opacity")
223
+ ]],
224
+ uniform float opacity_threshold = float(0.0) [[
225
+ anno::hard_range(0.0, 1.0),
226
+ anno::display_name("Opacity Threshold"),
227
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
228
+ anno::in_group("Opacity")
229
+ ]],
230
+
231
+
232
+
233
+ // Normal //
234
+
235
+ uniform float geometry_normal_roughness_strength = 1.f
236
+ [[
237
+ anno::hard_range(0.0, 1.0),
238
+ anno::display_name("Normal map to roughness weight"),
239
+ anno::description("Enables and weights roughness induced by normal maps"),
240
+ anno::in_group("Normal")
241
+ ]],
242
+ uniform float bump_factor = float(1.0) [[
243
+ anno::display_name("Normal Strength"),
244
+ anno::description("Strength of normal map"),
245
+ anno::in_group("Normal"),
246
+ anno::soft_range(float(0.0), float(1.0))
247
+ ]],
248
+ uniform texture_2d normalmap_texture = texture_2d() [[
249
+ anno::display_name("Normal Map"),
250
+ anno::in_group("Normal"),
251
+ anno::usage("normal")
252
+ ]],
253
+ uniform float detail_bump_factor = float(0.3) [[
254
+ anno::display_name("Detail Normal Strength"),
255
+ anno::in_group("Normal"),
256
+ anno::description("Strength of the detail normal"),
257
+ anno::soft_range(float(0.0), float(1.0))
258
+ ]],
259
+ uniform texture_2d detail_normalmap_texture = texture_2d() [[
260
+ anno::display_name("Detail Normal Map"),
261
+ anno::in_group("Normal"),
262
+ anno::usage("normal")
263
+ ]],
264
+ uniform bool flip_tangent_u = false [[
265
+ anno::display_name("Normal Map Flip U Tangent"),
266
+ anno::in_group("Normal")
267
+ ]],
268
+ uniform bool flip_tangent_v = true [[
269
+ anno::display_name("Normal Map Flip V Tangent"),
270
+ anno::in_group("Normal")
271
+ ]],
272
+
273
+ // UVW Projection Group //
274
+
275
+ uniform bool project_uvw = false [[
276
+ anno::display_name("Enable Project UVW Coordinates"),
277
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
278
+ anno::in_group("UV")
279
+ ]],
280
+ uniform bool world_or_object = false [[
281
+ anno::display_name("Enable World Space"),
282
+ anno::description("When enabled, uses world space for projection, otherwise object space is used"),
283
+ anno::in_group("UV"),
284
+ anno::enable_if("project_uvw == true")
285
+ ]],
286
+ uniform int uv_space_index = 0 [[
287
+ anno::display_name("UV Space Index"),
288
+ anno::description("UV Space Index."),
289
+ anno::in_group("UV"),
290
+ anno::enable_if("project_uvw == true"),
291
+ anno::hard_range(int(0), int(3))
292
+ ]],
293
+
294
+ // UVW Adjustments Group //
295
+
296
+ uniform float2 texture_translate = float2(0.0) [[
297
+ anno::display_name("Texture Translate"),
298
+ anno::description("Controls position of texture."),
299
+ anno::in_group("UV"),
300
+ anno::enable_if("project_uvw == true")
301
+ ]],
302
+ uniform float texture_rotate = float(0.0) [[
303
+ anno::display_name("Texture Rotate"),
304
+ anno::description("Rotates angle of texture in degrees."),
305
+ anno::in_group("UV"),
306
+ anno::enable_if("project_uvw == true")
307
+ ]],
308
+ uniform float2 texture_scale = float2(1.0) [[
309
+ anno::display_name("Texture Tiling"),
310
+ anno::description("Controls the repetition of the texture."),
311
+ anno::in_group("UV"),
312
+ anno::enable_if("project_uvw == true")
313
+ ]],
314
+ uniform float2 detail_texture_translate = float2(0.0) [[
315
+ anno::display_name("Detail Texture Translate"),
316
+ anno::description("Controls the position of the detail texture."),
317
+ anno::in_group("UV"),
318
+ anno::enable_if("project_uvw == true")
319
+ ]],
320
+ uniform float detail_texture_rotate = float(0.0) [[
321
+ anno::display_name("Detail Texture Rotate"),
322
+ anno::description("Rotates angle of the detail texture in degrees."),
323
+ anno::in_group("UV"),
324
+ anno::enable_if("project_uvw == true")
325
+ ]],
326
+ uniform float2 detail_texture_scale = float2(1.0) [[
327
+ anno::display_name("Detail Texture Tiling"),
328
+ anno::description("Controls the repetition of the detail texture."),
329
+ anno::in_group("UV"),
330
+ anno::enable_if("project_uvw == true")
331
+ ]]
332
+ )
333
+ [[
334
+ anno::display_name("OmniPBR"),
335
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
336
+ anno::in_group("Base"),
337
+ anno::version( 2, 1, 2),
338
+ anno::author("NVIDIA CORPORATION"),
339
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
340
+ ]] = let {
341
+
342
+ material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat(
343
+ diffuse_color_constant: diffuse_color_constant,
344
+ diffuse_texture: diffuse_texture,
345
+ albedo_desaturation: albedo_desaturation,
346
+ albedo_add: albedo_add,
347
+ albedo_brightness: albedo_brightness,
348
+ diffuse_tint: diffuse_tint,
349
+ reflection_roughness_constant: reflection_roughness_constant,
350
+ reflection_roughness_texture_influence: reflection_roughness_texture_influence,
351
+ reflectionroughness_texture: reflectionroughness_texture,
352
+ metallic_constant: metallic_constant,
353
+ metallic_texture_influence: metallic_texture_influence,
354
+ metallic_texture: metallic_texture,
355
+ specular_level: specular_level,
356
+ enable_ORM_texture: enable_ORM_texture,
357
+ ORM_texture: ORM_texture,
358
+ ao_to_diffuse: ao_to_diffuse,
359
+ ao_texture: ao_texture,
360
+ enable_emission: enable_emission,
361
+ emissive_color: emissive_color,
362
+ emissive_color_texture: emissive_color_texture,
363
+ emissive_mask_texture: emissive_mask_texture,
364
+ emissive_intensity: emissive_intensity,
365
+ enable_opacity: enable_opacity,
366
+ opacity_texture: opacity_texture,
367
+ opacity_constant: opacity_constant,
368
+ enable_opacity_texture: enable_opacity_texture,
369
+ opacity_mode: opacity_mode,
370
+ opacity_threshold: opacity_threshold,
371
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
372
+ bump_factor: bump_factor,
373
+ normalmap_texture: normalmap_texture,
374
+ detail_bump_factor: detail_bump_factor,
375
+ detail_normalmap_texture: detail_normalmap_texture,
376
+ flip_tangent_u: flip_tangent_u,
377
+ flip_tangent_v: flip_tangent_v,
378
+ project_uvw: project_uvw,
379
+ world_or_object: world_or_object,
380
+ uv_space_index: uv_space_index,
381
+ texture_translate: texture_translate,
382
+ texture_rotate: texture_rotate,
383
+ texture_scale: texture_scale,
384
+ detail_texture_translate: detail_texture_translate,
385
+ detail_texture_rotate: detail_texture_rotate,
386
+ detail_texture_scale: detail_texture_scale
387
+ );
388
+
389
+ } in material(
390
+ surface: base.surface,
391
+ geometry: base.geometry
392
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBRBase.mdl ADDED
@@ -0,0 +1,493 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::tex::*;
36
+ import ::anno::*;
37
+ import ::anno::*;
38
+
39
+ export float3 HemiOctahedronToUnitVector( float2 Oct ) [[
40
+ anno::hidden()
41
+ ]]
42
+ {
43
+ Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5;
44
+ float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) );
45
+ return math::normalize(N);
46
+ }
47
+
48
+ export struct NormalData [[
49
+ anno::hidden()
50
+ ]]
51
+ {
52
+ float3 normal;
53
+ float2 roughness;
54
+ };
55
+
56
+ export NormalData tangent_space_normal_roughness_texture(
57
+ uniform texture_2d texture
58
+ [[
59
+ anno::description("The input texture"),
60
+ anno::usage("normal")
61
+ ]],
62
+ uniform float factor = 1.0f
63
+ [[ anno::description("Determines the degree of bumpiness") ]],
64
+ uniform bool flip_tangent_u = false
65
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
66
+ uniform bool flip_tangent_v = false
67
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
68
+ base::texture_coordinate_info uvw = base::texture_coordinate_info()
69
+ [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]],
70
+ uniform float2 crop_u = float2( 0.0, 1.0)
71
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]],
72
+ uniform float2 crop_v = float2( 0.0, 1.0)
73
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]],
74
+ uniform tex::wrap_mode wrap_u = tex::wrap_repeat
75
+ [[ anno::description("Wrapping mode in the u direction") ]],
76
+ uniform tex::wrap_mode wrap_v = tex::wrap_repeat
77
+ [[ anno::description("Wrapping mode in the v direction") ]],
78
+ uniform bool clip = false
79
+ [[
80
+ anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"),
81
+ anno::hidden()
82
+ ]],
83
+ uniform float scale = 1.
84
+ [[
85
+ anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"),
86
+ anno::unused()
87
+ ]],
88
+ uniform float offset = 0.
89
+ [[
90
+ anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"),
91
+ anno::unused()
92
+ ]],
93
+ uniform float animation_start_time = 0.
94
+ [[ anno::description("When to start playing first frame of the animation ") ]],
95
+ uniform int2 animation_crop = int2(0, 0)
96
+ [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]],
97
+ uniform tex::wrap_mode animation_wrap = tex::wrap_repeat
98
+ [[ anno::description("Defines what to do outside of regular animation time") ]],
99
+ uniform float animation_fps = 30
100
+ [[ anno::description("Framerate to use for animation playback") ]]
101
+ )
102
+ [[
103
+ anno::description("Interprets the color values of a bitmap as a vector in tangent space"),
104
+ anno::hidden(),
105
+ anno::noinline()
106
+ ]]
107
+ {
108
+ NormalData normalData;
109
+ normalData.roughness = float2(0);
110
+ normalData.normal = state::normal();
111
+
112
+ float frame = 0.0;
113
+ if(animation_crop != int2(0,0)) //only if we have an animation
114
+ {
115
+ frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation
116
+ switch ( animation_wrap) {
117
+ case tex::wrap_repeat:
118
+ frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x:
119
+ math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y;
120
+ break;
121
+ case tex::wrap_mirrored_repeat:
122
+ float animation_crop_2y = 2.0*animation_crop.y;
123
+ frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x:
124
+ math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x;
125
+ if(frame>animation_crop.y)
126
+ frame = animation_crop_2y-frame;
127
+ break;
128
+ case tex::wrap_clamp:
129
+ frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y);
130
+ break;
131
+ case tex::wrap_clip:
132
+ frame += animation_crop.x;
133
+ if(frame < animation_crop.x || frame > animation_crop.y) return normalData;
134
+ break;
135
+ }
136
+ }
137
+
138
+ if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource
139
+ factor == 0.0f)
140
+ return normalData;
141
+ {
142
+ if (clip) {
143
+ if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) {
144
+ return normalData;
145
+ }
146
+ if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) {
147
+ return normalData;
148
+ }
149
+ }
150
+ if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) {
151
+ return normalData;
152
+ }
153
+ if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) {
154
+ return normalData;
155
+ }
156
+ }
157
+ bool pixel_flip_u = flip_tangent_u;
158
+ bool pixel_flip_v = flip_tangent_v;
159
+ //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
160
+ if (wrap_u == tex::wrap_mirrored_repeat) {
161
+ if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1)
162
+ pixel_flip_u = ! pixel_flip_u;
163
+ else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0)
164
+ pixel_flip_u = ! pixel_flip_u;
165
+ }
166
+ if (wrap_v == tex::wrap_mirrored_repeat) {
167
+ if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1)
168
+ pixel_flip_v = ! pixel_flip_v;
169
+ else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0)
170
+ pixel_flip_v = ! pixel_flip_v;
171
+ }
172
+
173
+ float3 transformed_tangent_u = uvw.tangent_u;
174
+ float3 transformed_tangent_v = uvw.tangent_v;
175
+
176
+ if (pixel_flip_u)
177
+ transformed_tangent_u=-transformed_tangent_u;
178
+ if (pixel_flip_v)
179
+ transformed_tangent_v=-transformed_tangent_v;
180
+
181
+ float3 tangent_space_normal;
182
+ float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame);
183
+ if(normal_raw.x > 1.5)
184
+ {
185
+ // octahedron packed by OV
186
+ normal_raw.x -= 2.0;
187
+ normal_raw.x -= 0.5;
188
+ normal_raw.y -= 0.5;
189
+ tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0);
190
+ normalData.roughness = float2(normal_raw.z, normal_raw.w);
191
+ }
192
+ else
193
+ {
194
+ // regular
195
+ tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0;
196
+ normalData.roughness = float2(0);
197
+ }
198
+
199
+ normalData.normal = math::normalize(
200
+ transformed_tangent_u * tangent_space_normal.x * factor +
201
+ transformed_tangent_v * tangent_space_normal.y * factor +
202
+ state::normal() * tangent_space_normal.z);
203
+
204
+ return normalData;
205
+ }
206
+
207
+
208
+ export material OmniPBRBase(
209
+
210
+
211
+ // Albdeo //
212
+
213
+ color diffuse_reflection_color = color(0.2) [[
214
+ anno::display_name("Albedo Color"),
215
+ anno::description("This is the albedo base color"),
216
+ anno::in_group("Albedo")
217
+ ]],
218
+ color diffuse_tint = color(1.0) [[
219
+ anno::display_name("Albedo Tint"),
220
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
221
+ anno::in_group("Albedo")
222
+ ]],
223
+
224
+
225
+ // Reflecitivity //
226
+
227
+ float specular_reflection_roughness = float(0.0) [[
228
+ anno::display_name("Roughness"),
229
+ anno::description("Higher roughness values lead to more blurry reflections"),
230
+ anno::in_group("Reflectivity"),
231
+ anno::hard_range(0.0, 1.0)
232
+ ]],
233
+ float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[
234
+ anno::display_name("Aniso roughness"),
235
+ anno::description("Higher roughness values lead to more blurry reflections"),
236
+ anno::in_group("Reflectivity"),
237
+ anno::hidden()
238
+ ]],
239
+ float metalness = float(0.0) [[
240
+ anno::display_name("Metalness"),
241
+ anno::description("Bias towards pure specular reflection"),
242
+ anno::in_group("Reflectivity"),
243
+ anno::hard_range(0.0, 1.0)
244
+ ]],
245
+ float specular_level = float(0.5) [[
246
+ anno::display_name("Specular"),
247
+ anno::description("The specular level (intensity) of the material"),
248
+ anno::in_group("Reflectivity"),
249
+ anno::soft_range(0.0, 1.0)
250
+ ]],
251
+
252
+
253
+ // Emission //
254
+
255
+ uniform bool enable_emission = false [[
256
+ anno::display_name("Enable Emission"),
257
+ anno::description("Enables the emission of light from the material"),
258
+ anno::in_group("Emissive")
259
+ ]],
260
+ color emission_color = color(1.0,0.1,0.1) [[
261
+ anno::display_name("Emissive Color"),
262
+ anno::description("The emission color"),
263
+ anno::in_group("Emissive"),
264
+ anno::enable_if("enable_emission == true")
265
+ ]],
266
+ float emission_intensity = float(40.0) [[
267
+ anno::display_name("Emissive Intensity"),
268
+ anno::description("Intensity of the emission"),
269
+ anno::in_group("Emissive"),
270
+ anno::soft_range(0.0, 1000.0),
271
+ anno::enable_if("enable_emission == true")
272
+ ]],
273
+
274
+
275
+ // Geometry Opacity //
276
+
277
+ uniform bool enable_opacity = false [[
278
+ anno::display_name("Enable Opacity"),
279
+ anno::description("Enables the use of cutout opacity"),
280
+ anno::in_group("Opacity")
281
+ ]],
282
+ float geometry_opacity = float(1.0) [[
283
+ anno::display_name("Opacity Amount"),
284
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
285
+ anno::in_group("Opacity"),
286
+ anno::hard_range(0.0, 1.0)
287
+ ]],
288
+ uniform float geometry_opacity_threshold = 0.f
289
+ [[
290
+ anno::display_name("Opacity Threshold"),
291
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
292
+ anno::in_group("Opacity"),
293
+ anno::hard_range(0.0, 1.0)
294
+ ]],
295
+
296
+
297
+ // Clearcoat //
298
+
299
+ uniform bool enable_coat = false [[
300
+ anno::display_name("Enable Clearcoat Layer"),
301
+ anno::description("Adds a coat layer on top of the material when enabled"),
302
+ anno::in_group("Clearcoat")
303
+ ]],
304
+ float coat_weight = float(1.0) [[
305
+ anno::display_name("Clearcoat Weight"),
306
+ anno::description("Sets the weight for coat layer"),
307
+ anno::in_group("Clearcoat"),
308
+ anno::hard_range(0.0, 1.0)
309
+ ]],
310
+ color coat_color = color(1.0) [[
311
+ anno::display_name("Clearcoat Tint"),
312
+ anno::description("Clearcoat is tinted and affects the underlying material"),
313
+ anno::in_group("Clearcoat")
314
+ ]],
315
+ float coat_transparency = float(1.0) [[
316
+ anno::display_name("Clearcoat Transparency"),
317
+ anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"),
318
+ anno::in_group("Clearcoat"),
319
+ anno::hard_range(0.0, 1.0)
320
+ ]],
321
+ float coat_roughness = float(0.0) [[
322
+ anno::display_name("Clearcoat Roughness"),
323
+ anno::description("Higher roughness values lead to more blurry reflections"),
324
+ anno::in_group("Clearcoat"),
325
+ anno::hard_range(0.0, 1.0)
326
+ ]],
327
+ float2 coat_aniso_roughness = float2(0.0, 0.0) [[
328
+ anno::display_name("Clearcoat aniso roughness"),
329
+ anno::description("Higher roughness values lead to more blurry reflections"),
330
+ anno::in_group("Clearcoat"),
331
+ anno::hidden()
332
+ ]],
333
+ float coat_ior = float(1.56) [[
334
+ anno::display_name("Clearcoat IOR"),
335
+ anno::description("Sets the Index of refraction for the coat layer"),
336
+ anno::in_group("Clearcoat"),
337
+ anno::soft_range(0.0, 4.0)
338
+ ]],
339
+ float3 clearcoat_geometry_normal = state::normal() [[
340
+ anno::display_name("Clearcoat Normal"),
341
+ anno::in_group("Clearcoat"),
342
+ anno::usage("normal")
343
+ ]],
344
+
345
+
346
+ // Geometry //
347
+
348
+ uniform float round_edges_radius = float(0.0) [[
349
+ anno::display_name("Round Edge Radius"),
350
+ anno::description("Influence radius around the edges in meters"),
351
+ anno::in_group("Geometry"),
352
+ anno::soft_range(0.0, 1.0)
353
+ ]],
354
+ uniform float round_edges_roundness = float(1.0) [[
355
+ anno::display_name("Round Edge Roundness"),
356
+ anno::description("Determines how round the edge will look"),
357
+ anno::in_group("Geometry"),
358
+ anno::hard_range(0.0, 1.0)
359
+ ]],
360
+ uniform bool round_edges_across_materials = false [[
361
+ anno::display_name("Round Edge Across Materials"),
362
+ anno::description("Normal smoothing happens only between facets of equal material, \n"
363
+ "\t\tunless this parameter is set true, in which case the smoothing \n"
364
+ "\t\thappens between facets irrespective of their materials"),
365
+ anno::in_group("Geometry")
366
+ ]],
367
+ float3 geometry_normal = state::normal() [[
368
+ anno::display_name("Geometry Normal"),
369
+ anno::in_group("Geometry"),
370
+ anno::usage("normal")
371
+ ]]
372
+
373
+ )
374
+ [[
375
+ anno::display_name("OmniPBR Base"),
376
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
377
+ anno::in_group("Omni Materials"),
378
+ anno::version( 2, 1, 1),
379
+ anno::author("NVIDIA CORPORATION"),
380
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
381
+ ]]
382
+ = let{
383
+
384
+ // Diffuse Bsdf //
385
+
386
+ color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint;
387
+
388
+ color base_color = tinted_diffuse_color;
389
+
390
+ bsdf diffuse_bsdf = df::weighted_layer(
391
+ weight: 1.0,
392
+ layer: df::diffuse_reflection_bsdf(
393
+ tint: base_color,
394
+ roughness: float(0.0)
395
+ ),
396
+ base: bsdf(),
397
+ normal: geometry_normal
398
+ );
399
+
400
+ // Glossy Reflection Bsdf //
401
+
402
+ float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness
403
+ + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1);
404
+ float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness
405
+ + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1);
406
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
407
+ roughness_u: roughness_u,
408
+ roughness_v: roughness_v,
409
+ tint: color(1.0),
410
+ mode: df::scatter_reflect
411
+ );
412
+
413
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
414
+ normal_reflectivity: 0.08,
415
+ grazing_reflectivity: 1.0,
416
+ exponent: 5.0,
417
+ weight: specular_level,
418
+ layer: ggx_smith_bsdf,
419
+ base: diffuse_bsdf,
420
+ normal: geometry_normal
421
+ );
422
+
423
+ bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
424
+
425
+ bsdf omni_PBR_bsdf = df::weighted_layer(
426
+ weight: metalness,
427
+ layer: directional_factor_bsdf,
428
+ base: custom_curve_layer_bsdf,
429
+ normal: geometry_normal
430
+ );
431
+
432
+ // Clear Coat //
433
+
434
+ float coat_roughness_u = math::clamp(coat_roughness * coat_roughness
435
+ + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1);
436
+ float coat_roughness_v = math::clamp(coat_roughness * coat_roughness
437
+ + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1);
438
+ bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf(
439
+ roughness_u: coat_roughness_u,
440
+ roughness_v: coat_roughness_v,
441
+ tint: color(1.0),
442
+ mode: df::scatter_reflect
443
+ );
444
+
445
+ bsdf opaque_coat = df::weighted_layer(
446
+ weight: coat_transparency,
447
+ layer: ::df::tint(
448
+ tint: coat_color,
449
+ base: omni_PBR_bsdf
450
+ ),
451
+ base: ::df::diffuse_reflection_bsdf(
452
+ tint: coat_color
453
+ )
454
+ );
455
+
456
+ bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
457
+ ior: coat_ior,
458
+ weight: coat_weight,
459
+ layer: coat_bsdf,
460
+ base: opaque_coat,
461
+ normal: clearcoat_geometry_normal
462
+ );
463
+
464
+ bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
465
+
466
+ color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0);
467
+
468
+ float opacity_value = geometry_opacity;
469
+ float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0;
470
+
471
+ material_emission emission = material_emission(
472
+ df::diffuse_edf(),
473
+ intensity: emission_value
474
+ );
475
+
476
+ material_surface surface = material_surface(
477
+ scattering: final_bsdf,
478
+ emission: emission
479
+ );
480
+
481
+ material_geometry geometry = material_geometry(
482
+ normal: state::rounded_corner_normal(
483
+ radius: round_edges_radius,
484
+ across_materials: round_edges_across_materials,
485
+ roundness: round_edges_roundness
486
+ ),
487
+ cutout_opacity: cutout_opacity
488
+ );
489
+
490
+ } in material(
491
+ surface: surface,
492
+ geometry: geometry
493
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBRBase_1.mdl ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::tex::*;
36
+ import ::anno::*;
37
+ import ::anno::*;
38
+
39
+ export float3 HemiOctahedronToUnitVector( float2 Oct )
40
+ {
41
+ Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5;
42
+ float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) );
43
+ return math::normalize(N);
44
+ }
45
+
46
+ export struct NormalData {
47
+ float3 normal;
48
+ float2 roughness;
49
+ };
50
+
51
+ export NormalData tangent_space_normal_roughness_texture(
52
+ uniform texture_2d texture
53
+ [[
54
+ anno::description("The input texture"),
55
+ anno::usage("normal")
56
+ ]],
57
+ uniform float factor = 1.0f
58
+ [[ anno::description("Determines the degree of bumpiness") ]],
59
+ uniform bool flip_tangent_u = false
60
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
61
+ uniform bool flip_tangent_v = false
62
+ [[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
63
+ base::texture_coordinate_info uvw = base::texture_coordinate_info()
64
+ [[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]],
65
+ uniform float2 crop_u = float2( 0.0, 1.0)
66
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]],
67
+ uniform float2 crop_v = float2( 0.0, 1.0)
68
+ [[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]],
69
+ uniform tex::wrap_mode wrap_u = tex::wrap_repeat
70
+ [[ anno::description("Wrapping mode in the u direction") ]],
71
+ uniform tex::wrap_mode wrap_v = tex::wrap_repeat
72
+ [[ anno::description("Wrapping mode in the v direction") ]],
73
+ uniform bool clip = false
74
+ [[
75
+ anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"),
76
+ anno::hidden()
77
+ ]],
78
+ uniform float scale = 1.
79
+ [[
80
+ anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"),
81
+ anno::unused()
82
+ ]],
83
+ uniform float offset = 0.
84
+ [[
85
+ anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"),
86
+ anno::unused()
87
+ ]],
88
+ uniform float animation_start_time = 0.
89
+ [[ anno::description("When to start playing first frame of the animation ") ]],
90
+ uniform int2 animation_crop = int2(0, 0)
91
+ [[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]],
92
+ uniform tex::wrap_mode animation_wrap = tex::wrap_repeat
93
+ [[ anno::description("Defines what to do outside of regular animation time") ]],
94
+ uniform float animation_fps = 30
95
+ [[ anno::description("Framerate to use for animation playback") ]]
96
+ )
97
+ [[
98
+ anno::description("Interprets the color values of a bitmap as a vector in tangent space"),
99
+ anno::noinline()
100
+ ]]
101
+ {
102
+ NormalData normalData;
103
+ normalData.roughness = float2(0);
104
+ normalData.normal = state::normal();
105
+
106
+ float frame = 0.0;
107
+ if(animation_crop != int2(0,0)) //only if we have an animation
108
+ {
109
+ frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation
110
+ switch ( animation_wrap) {
111
+ case tex::wrap_repeat:
112
+ frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x:
113
+ math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y;
114
+ break;
115
+ case tex::wrap_mirrored_repeat:
116
+ float animation_crop_2y = 2.0*animation_crop.y;
117
+ frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x:
118
+ math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x;
119
+ if(frame>animation_crop.y)
120
+ frame = animation_crop_2y-frame;
121
+ break;
122
+ case tex::wrap_clamp:
123
+ frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y);
124
+ break;
125
+ case tex::wrap_clip:
126
+ frame += animation_crop.x;
127
+ if(frame < animation_crop.x || frame > animation_crop.y) return normalData;
128
+ break;
129
+ }
130
+ }
131
+
132
+ if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource
133
+ factor == 0.0f)
134
+ return normalData;
135
+ {
136
+ if (clip) {
137
+ if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) {
138
+ return normalData;
139
+ }
140
+ if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) {
141
+ return normalData;
142
+ }
143
+ }
144
+ if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) {
145
+ return normalData;
146
+ }
147
+ if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) {
148
+ return normalData;
149
+ }
150
+ }
151
+ bool pixel_flip_u = flip_tangent_u;
152
+ bool pixel_flip_v = flip_tangent_v;
153
+ //if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
154
+ if (wrap_u == tex::wrap_mirrored_repeat) {
155
+ if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1)
156
+ pixel_flip_u = ! pixel_flip_u;
157
+ else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0)
158
+ pixel_flip_u = ! pixel_flip_u;
159
+ }
160
+ if (wrap_v == tex::wrap_mirrored_repeat) {
161
+ if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1)
162
+ pixel_flip_v = ! pixel_flip_v;
163
+ else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0)
164
+ pixel_flip_v = ! pixel_flip_v;
165
+ }
166
+
167
+ float3 transformed_tangent_u = uvw.tangent_u;
168
+ float3 transformed_tangent_v = uvw.tangent_v;
169
+
170
+ if (pixel_flip_u)
171
+ transformed_tangent_u=-transformed_tangent_u;
172
+ if (pixel_flip_v)
173
+ transformed_tangent_v=-transformed_tangent_v;
174
+
175
+ float3 tangent_space_normal;
176
+ float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame);
177
+ if(normal_raw.x > 1.5)
178
+ {
179
+ // octahedron packed by OV
180
+ normal_raw.x -= 2.0;
181
+ normal_raw.x -= 0.5;
182
+ normal_raw.y -= 0.5;
183
+ tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0);
184
+ normalData.roughness = float2(normal_raw.z, normal_raw.w);
185
+ }
186
+ else
187
+ {
188
+ // regular
189
+ tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0;
190
+ normalData.roughness = float2(0);
191
+ }
192
+
193
+ normalData.normal = math::normalize(
194
+ transformed_tangent_u * tangent_space_normal.x * factor +
195
+ transformed_tangent_v * tangent_space_normal.y * factor +
196
+ state::normal() * tangent_space_normal.z);
197
+
198
+ return normalData;
199
+ }
200
+
201
+
202
+ export material OmniPBRBase(
203
+
204
+
205
+ // Albdeo //
206
+
207
+ color diffuse_reflection_color = color(0.2) [[
208
+ anno::display_name("Albedo Color"),
209
+ anno::description("This is the albedo base color"),
210
+ anno::in_group("Albedo")
211
+ ]],
212
+ color diffuse_tint = color(1.0) [[
213
+ anno::display_name("Albedo Tint"),
214
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
215
+ anno::in_group("Albedo")
216
+ ]],
217
+
218
+
219
+ // Reflecitivity //
220
+
221
+ float specular_reflection_roughness = float(0.0) [[
222
+ anno::display_name("Roughness"),
223
+ anno::description("Higher roughness values lead to more blurry reflections"),
224
+ anno::in_group("Reflectivity")
225
+ ]],
226
+ float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[
227
+ anno::display_name("Aniso roughness"),
228
+ anno::description("Higher roughness values lead to more blurry reflections"),
229
+ anno::in_group("Reflectivity"),
230
+ anno::hidden()
231
+ ]],
232
+ float metalness = float(0.0) [[
233
+ anno::display_name("Metalness"),
234
+ anno::description("Bias towards pure specular reflection"),
235
+ anno::in_group("Reflectivity"),
236
+ anno::hard_range(float(0.0), float(1.0))
237
+ ]],
238
+ float specular_level = float(0.5) [[
239
+ anno::display_name("Specular"),
240
+ anno::description("The specular level (intensity) of the material"),
241
+ anno::in_group("Reflectivity"),
242
+ anno::soft_range(float(0.0), float(1.0))
243
+ ]],
244
+
245
+
246
+ // Emission //
247
+
248
+ uniform bool enable_emission = false [[
249
+ anno::display_name("Enable Emission"),
250
+ anno::description("Enables the emission of light from the material"),
251
+ anno::in_group("Emissive")
252
+ ]],
253
+ color emission_color = color(1.0,0.1,0.1) [[
254
+ anno::display_name("Emissive Color"),
255
+ anno::description("The emission color"),
256
+ anno::in_group("Emissive"),
257
+ anno::enable_if("enable_emission == true")
258
+ ]],
259
+ float emission_intensity = float(40.0) [[
260
+ anno::display_name("Emissive Intensity"),
261
+ anno::description("Intensity of the emission"),
262
+ anno::in_group("Emissive"),
263
+ anno::enable_if("enable_emission == true")
264
+ ]],
265
+
266
+
267
+ // Geometry Opacity //
268
+
269
+ uniform bool enable_opacity = false [[
270
+ anno::display_name("Enable Opacity"),
271
+ anno::description("Enables the use of cutout opacity"),
272
+ anno::in_group("Opacity")
273
+ ]],
274
+ float geometry_opacity = float(1.0) [[
275
+ anno::display_name("Opacity Amount"),
276
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
277
+ anno::in_group("Opacity"),
278
+ anno::hard_range(float(0.0), float(1.0))
279
+ ]],
280
+ uniform float geometry_opacity_threshold = 0.f
281
+ [[
282
+ anno::hard_range(0.0, 1.0),
283
+ anno::display_name("Opacity Threshold"),
284
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
285
+ anno::in_group("Opacity")
286
+ ]],
287
+
288
+
289
+ // Clearcoat //
290
+
291
+ uniform bool enable_coat = false [[
292
+ anno::display_name("Enable Clearcoat Layer"),
293
+ anno::description("Adds a coat layer on top of the material when enabled"),
294
+ anno::in_group("Clearcoat")
295
+ ]],
296
+ float coat_weight = float(1.0) [[
297
+ anno::display_name("Clearcoat Weight"),
298
+ anno::description("Sets the weight for coat layer"),
299
+ anno::in_group("Clearcoat"),
300
+ anno::hard_range(float(0.0), float(1.0))
301
+ ]],
302
+ color coat_color = color(1.0) [[
303
+ anno::display_name("Clearcoat Tint"),
304
+ anno::description("Clearcoat is tinted and affects the underlying material"),
305
+ anno::in_group("Clearcoat")
306
+ ]],
307
+ float coat_transparency = float(1.0) [[
308
+ anno::display_name("Clearcoat Transparency"),
309
+ anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"),
310
+ anno::in_group("Clearcoat"),
311
+ anno::hard_range(float(0.0), float(1.0))
312
+ ]],
313
+ float coat_roughness = float(0.0) [[
314
+ anno::display_name("Clearcoat Roughness"),
315
+ anno::description("Higher roughness values lead to more blurry reflections"),
316
+ anno::in_group("Clearcoat")
317
+ ]],
318
+ float2 coat_aniso_roughness = float2(0.0, 0.0) [[
319
+ anno::display_name("Clearcoat aniso roughness"),
320
+ anno::description("Higher roughness values lead to more blurry reflections"),
321
+ anno::in_group("Clearcoat"),
322
+ anno::hidden()
323
+ ]],
324
+ float coat_ior = float(1.56) [[
325
+ anno::display_name("Clearcoat IOR"),
326
+ anno::description("Sets the Index of refraction for the coat layer"),
327
+ anno::in_group("Clearcoat"),
328
+ anno::soft_range(float(0.0), float(4.0))
329
+ ]],
330
+ float3 clearcoat_geometry_normal = state::normal() [[
331
+ anno::display_name("Clearcoat Normal"),
332
+ anno::in_group("Clearcoat"),
333
+ anno::usage("normal")
334
+ ]],
335
+
336
+
337
+ // Geometry //
338
+
339
+ float3 geometry_normal = state::normal() [[
340
+ anno::display_name("Geometry Normal"),
341
+ anno::in_group("Geometry"),
342
+ anno::usage("normal")
343
+ ]]
344
+
345
+ )
346
+ [[
347
+ anno::display_name("OmniPBR Base"),
348
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
349
+ anno::in_group("Base"),
350
+ anno::version( 2, 1, 1),
351
+ anno::author("NVIDIA CORPORATION"),
352
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
353
+ ]]
354
+ = let{
355
+
356
+ // Diffuse Bsdf //
357
+
358
+ color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint;
359
+
360
+ color base_color = tinted_diffuse_color;
361
+
362
+ bsdf diffuse_bsdf = df::weighted_layer(
363
+ weight: 1.0,
364
+ layer: df::diffuse_reflection_bsdf(
365
+ tint: base_color,
366
+ roughness: float(0.0)
367
+ ),
368
+ base: bsdf(),
369
+ normal: enable_coat ? geometry_normal : state::normal()
370
+ );
371
+
372
+ // Glossy Reflection Bsdf //
373
+
374
+ float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness
375
+ + specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1);
376
+ float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness
377
+ + specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1);
378
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
379
+ roughness_u: roughness_u,
380
+ roughness_v: roughness_v,
381
+ tint: color(1.0),
382
+ mode: df::scatter_reflect
383
+ );
384
+
385
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
386
+ normal_reflectivity: 0.08,
387
+ grazing_reflectivity: 1.0,
388
+ exponent: 5.0,
389
+ weight: specular_level,
390
+ layer: ggx_smith_bsdf,
391
+ base: diffuse_bsdf,
392
+ normal: enable_coat ? geometry_normal : state::normal()
393
+ );
394
+
395
+ bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
396
+
397
+ bsdf omni_PBR_bsdf = df::weighted_layer(
398
+ weight: metalness,
399
+ layer: directional_factor_bsdf,
400
+ base: custom_curve_layer_bsdf,
401
+ normal: enable_coat ? geometry_normal : state::normal()
402
+ );
403
+
404
+ // Clear Coat //
405
+
406
+ float coat_roughness_u = math::clamp(coat_roughness * coat_roughness
407
+ + coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1);
408
+ float coat_roughness_v = math::clamp(coat_roughness * coat_roughness
409
+ + coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1);
410
+ bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf(
411
+ roughness_u: coat_roughness_u,
412
+ roughness_v: coat_roughness_v,
413
+ tint: color(1.0),
414
+ mode: df::scatter_reflect
415
+ );
416
+
417
+ bsdf opaque_coat = df::weighted_layer(
418
+ weight: coat_transparency,
419
+ layer: ::df::tint(
420
+ tint: coat_color,
421
+ base: omni_PBR_bsdf
422
+ ),
423
+ base: ::df::diffuse_reflection_bsdf(
424
+ tint: coat_color
425
+ )
426
+ );
427
+
428
+ bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
429
+ ior: coat_ior,
430
+ weight: coat_weight,
431
+ layer: coat_bsdf,
432
+ base: opaque_coat,
433
+ normal: clearcoat_geometry_normal
434
+ );
435
+
436
+ bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
437
+
438
+ color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0);
439
+
440
+ float opacity_value = geometry_opacity;
441
+ float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0;
442
+
443
+ material_emission emission = material_emission(
444
+ df::diffuse_edf(),
445
+ intensity: emission_value
446
+ );
447
+
448
+ material_surface surface = material_surface(
449
+ scattering: final_bsdf,
450
+ emission: emission
451
+ );
452
+
453
+ material_geometry geometry = material_geometry(
454
+ normal: enable_coat ? state::normal(): geometry_normal,
455
+ cutout_opacity: cutout_opacity
456
+ );
457
+
458
+ } in material(
459
+ surface: surface,
460
+ geometry: geometry
461
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_ClearCoat.mdl ADDED
@@ -0,0 +1,707 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ mdl 1.7;
30
+
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::anno::*;
38
+
39
+ import ::debug::*;
40
+
41
+ import ::nvidia::core_definitions::file_texture;
42
+ import ::nvidia::core_definitions::normalmap_texture;
43
+
44
+ import OmniPBRBase_1::*;
45
+
46
+ // Functions //
47
+
48
+
49
+ // Returns a matrix from R,T,S. inputs //
50
+
51
+ uniform float4x4 rotation_translation_scale(
52
+ uniform float3 rotation = float3(0.)
53
+ [[ anno::description("Rotation applied to every UVW coordinate") ]],
54
+ uniform float3 translation = float3(0.)
55
+ [[ anno::description("Offset applied to every UVW coordinate") ]],
56
+ uniform float3 scaling = float3(1.)
57
+ [[ anno::description("Scale applied to every UVW coordinate") ]]
58
+ )
59
+ [[
60
+ anno::description("Construct a transformation matrix from euler rotation, translation and scale"),
61
+ anno::hidden()
62
+ ]]
63
+ {
64
+ float4x4 scale =
65
+ float4x4(scaling.x , 0.0 , 0.0 , 0.0,
66
+ 0.0 , scaling.y , 0.0 , 0.0,
67
+ 0.0 , 0.0 , scaling.z , 0.0,
68
+ translation.x , translation.y , translation.z , 1.0);
69
+
70
+ float3 s = math::sin(rotation);
71
+ float3 c = math::cos(rotation);
72
+
73
+ float4x4 rotate =
74
+ 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,
75
+ 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,
76
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
77
+ 0.0 , 0.0 , 0 , 1.0);
78
+
79
+ return scale * rotate;
80
+ }
81
+
82
+ // Returns the normal n in tangent space, given n is in internal space. //
83
+
84
+ float3 transform_internal_to_tangent(float3 n)
85
+ {
86
+ /* flip_tangent_v */
87
+ return
88
+ n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+
89
+ n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+
90
+ n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z);
91
+ }
92
+
93
+ // Returns the normal n in internal space, given n is in tangent space.
94
+ float3 transform_tangent_to_internal(float3 n)
95
+ {
96
+ return state::texture_tangent_u(0) * n.x -
97
+ state::texture_tangent_v(0) * n.y + /* flip_tangent_v */
98
+ state::normal() * n.z;
99
+ }
100
+
101
+ // Returns a normal by adding a detail normal to a global normal.
102
+ export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
103
+ {
104
+ // http://blog.selfshadow.com/publications/blending-in-detail/
105
+ float3 n_t = transform_internal_to_tangent(n);
106
+ float3 nd_t = transform_internal_to_tangent(nd);
107
+ n_t = n_t + float3(0.,0.,1.);
108
+ nd_t = nd_t * float3(-1.,-1.,1.);
109
+ n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t;
110
+ return math::normalize(transform_tangent_to_internal(n));
111
+ }
112
+
113
+ base::texture_return multiply_colors(
114
+ color color_1 = color(1.0, 1.0, 1.0),
115
+ color color_2 = color(.5, .5, .5),
116
+ float weight = 1.0
117
+ )
118
+ [[
119
+ anno::hidden()
120
+ ]]
121
+ {
122
+ return base::blend_color_layers(
123
+ layers: base::color_layer[](
124
+ base::color_layer(
125
+ layer_color: color_2,
126
+ weight: weight,
127
+ mode: base::color_layer_multiply
128
+ )),
129
+ base: color_1
130
+ );
131
+ }
132
+
133
+
134
+ // OmniPBR Clearcoat //
135
+
136
+ export material OmniPBR_ClearCoat(
137
+
138
+ // Albdeo //
139
+
140
+ color diffuse_color_constant = color(0.2) [[
141
+ anno::display_name("Albedo Color"),
142
+ anno::description("This is the albedo base color"),
143
+ anno::in_group("Albedo")
144
+ ]],
145
+ uniform texture_2d diffuse_texture = texture_2d() [[
146
+ anno::display_name("Albedo Map"),
147
+ anno::in_group("Albedo")
148
+ ]],
149
+ float albedo_desaturation = float(0.0) [[
150
+ anno::display_name("Albedo Desaturation"),
151
+ anno::description("Desaturates the diffuse color"),
152
+ anno::in_group("Albedo"),
153
+ anno::soft_range(float(0.0), float(1.0))
154
+ ]],
155
+ float albedo_add = float(0.0) [[
156
+ anno::display_name("Albedo Add"),
157
+ anno::description("Adds a constant value to the diffuse color "),
158
+ anno::in_group("Albedo"),
159
+ anno::soft_range(float(-1.0), float(1.0))
160
+ ]],
161
+ float albedo_brightness = float(1.0) [[
162
+ anno::display_name("Albedo Brightness"),
163
+ anno::description("Multiplier for the diffuse color "),
164
+ anno::in_group("Albedo"),
165
+ anno::soft_range(float(0.0), float(1.0))
166
+ ]],
167
+ color diffuse_tint = color(1.0) [[
168
+ anno::display_name("Color Tint"),
169
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
170
+ anno::in_group("Albedo")
171
+ ]],
172
+
173
+
174
+ // Reflectivity //
175
+
176
+ float reflection_roughness_constant = float(0.5) [[
177
+ anno::display_name("Roughness Amount"),
178
+ anno::description("Higher roughness values lead to more blurry reflections"),
179
+ anno::in_group("Reflectivity"),
180
+ anno::hard_range(float(0.0), float(1.0))
181
+ ]],
182
+ float reflection_roughness_texture_influence = float(0.0) [[
183
+ anno::display_name("Roughness Map Influence"),
184
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
185
+ anno::in_group("Reflectivity"),
186
+ anno::hard_range(float(0.0), float(1.0))
187
+ ]],
188
+ uniform texture_2d reflectionroughness_texture = texture_2d() [[
189
+ anno::display_name("Roughness Map"),
190
+ anno::in_group("Reflectivity"),
191
+ anno::usage("roughness")
192
+ ]],
193
+ float metallic_constant = float(0.0) [[
194
+ anno::display_name("Metallic Amount"),
195
+ anno::description("Metallic Material"),
196
+ anno::in_group("Reflectivity"),
197
+ anno::hard_range(float(0.0), float(1.0))
198
+ ]],
199
+ float metallic_texture_influence = float(0.0) [[
200
+ anno::display_name("Metallic Map Influence"),
201
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
202
+ anno::in_group("Reflectivity"),
203
+ anno::hard_range(float(0.0), float(1.0))
204
+ ]],
205
+ uniform texture_2d metallic_texture = texture_2d() [[
206
+ anno::display_name("Metallic Map"),
207
+ anno::in_group("Reflectivity"),
208
+ anno::usage("metalness")
209
+ ]],
210
+ float specular_level = float(0.5) [[
211
+ anno::display_name("Specular"),
212
+ anno::description("The specular level (intensity) of the material"),
213
+ anno::in_group("Reflectivity"),
214
+ anno::soft_range(float(0.0), float(1.0))
215
+ ]],
216
+
217
+
218
+ // ORM //
219
+
220
+ uniform bool enable_ORM_texture = false [[
221
+ anno::display_name("Enable ORM Texture"),
222
+ anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
223
+ anno::in_group("Reflectivity")
224
+ ]],
225
+ uniform texture_2d ORM_texture = texture_2d() [[
226
+ anno::display_name("ORM Map"),
227
+ anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
228
+ anno::in_group("Reflectivity"),
229
+ anno::usage("roughness")
230
+ ]],
231
+
232
+
233
+ // AO Group //
234
+
235
+ float ao_to_diffuse = 0.0 [[
236
+ anno::display_name("AO to diffuse"),
237
+ anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
238
+ anno::in_group("AO"),
239
+ anno::hard_range(float(0.0), float(1.0))
240
+ ]],
241
+ uniform texture_2d ao_texture = texture_2d() [[
242
+ anno::display_name("Ambient Occlusion Map"),
243
+ anno::description("The ambient occlusion texture for the material"),
244
+ anno::in_group("AO"),
245
+ anno::usage("occlusion")
246
+ ]],
247
+
248
+
249
+ // Emission //
250
+
251
+ uniform bool enable_emission = false [[
252
+ anno::display_name("Enable Emission"),
253
+ anno::description("Enables the emission of light from the material"),
254
+ anno::in_group("Emissive")
255
+ ]],
256
+ color emissive_color = color(1.0,0.1,0.1) [[
257
+ anno::display_name("Emissive Color"),
258
+ anno::description("The emission color"),
259
+ anno::in_group("Emissive"),
260
+ anno::enable_if("enable_emission == true")
261
+ ]],
262
+ uniform texture_2d emissive_color_texture = texture_2d() [[
263
+ anno::display_name("Emissive Color map"),
264
+ anno::in_group("Emissive"),
265
+ anno::description("The emissive color texture"),
266
+ anno::enable_if("enable_emission == true")
267
+ ]],
268
+ uniform texture_2d emissive_mask_texture = texture_2d() [[
269
+ anno::display_name("Emissive Mask map"),
270
+ anno::description("The texture masking the emissive color"),
271
+ anno::in_group("Emissive"),
272
+ anno::enable_if("enable_emission == true"),
273
+ anno::usage("occlusion")
274
+ ]],
275
+ float emissive_intensity = float(40.0) [[
276
+ anno::display_name("Emissive Intensity"),
277
+ anno::description("Intensity of the emission"),
278
+ anno::in_group("Emissive"),
279
+ anno::enable_if("enable_emission == true")
280
+ ]],
281
+
282
+
283
+ // Cutout Opacity //
284
+
285
+ uniform bool enable_opacity = false [[
286
+ anno::display_name("Enable Opacity"),
287
+ anno::description("Enables the use of cutout opacity"),
288
+ anno::in_group("Opacity")
289
+ ]],
290
+ uniform texture_2d opacity_texture = texture_2d() [[
291
+ anno::display_name("Opacity Map"),
292
+ anno::in_group("Opacity"),
293
+ anno::usage("opacity")
294
+ ]],
295
+ float opacity_constant = float(1.0) [[
296
+ anno::display_name("Opacity Amount"),
297
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
298
+ anno::in_group("Opacity"),
299
+ anno::hard_range(float(0.0), float(1.0))
300
+ ]],
301
+ uniform bool enable_opacity_texture = false [[
302
+ anno::display_name("Enable Opacity Texture"),
303
+ anno::description("Enables or disables the usage of the opacity texture map"),
304
+ anno::in_group("Opacity")
305
+ ]],
306
+ uniform base::mono_mode opacity_mode = base::mono_average [[
307
+ anno::display_name("Opacity Mono Source"),
308
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
309
+ anno::in_group("Opacity")
310
+ ]],
311
+ uniform float opacity_threshold = float(0.0) [[
312
+ anno::display_name("Opacity Threshold"),
313
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
314
+ anno::in_group("Opacity"),
315
+ anno::hard_range(float(0.0), float(1.0))
316
+ ]],
317
+
318
+
319
+ // Clearcoat //
320
+
321
+ uniform bool enable_clearcoat = false [[
322
+ anno::display_name("Enable Clearcoat Layer"),
323
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
324
+ anno::in_group("Clearcoat")
325
+ ]],
326
+ float clearcoat_weight = float(1.0) [[
327
+ anno::display_name("Clearcoat Weight"),
328
+ anno::description("Sets the weight for clearcoat layer"),
329
+ anno::in_group("Clearcoat"),
330
+ anno::hard_range(float(0.0), float(1.0))
331
+ ]],
332
+ color clearcoat_tint = color(1.0) [[
333
+ anno::display_name("Clearcoat Tint"),
334
+ anno::description("Clearcoat is tinted and affects the underlying material"),
335
+ anno::in_group("Clearcoat")
336
+ ]],
337
+ float clearcoat_transparency = float(1.0) [[
338
+ anno::display_name("Clearcoat Transparency"),
339
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"),
340
+ anno::in_group("Clearcoat"),
341
+ anno::hard_range(float(0.0), float(1.0))
342
+ ]],
343
+ float clearcoat_reflection_roughness = float(0.0) [[
344
+ anno::display_name("Clearcoat Roughness"),
345
+ anno::description("Higher roughness values lead to more blurry reflections"),
346
+ anno::in_group("Clearcoat"),
347
+ anno::hard_range(float(0.0), float(1.0))
348
+ ]],
349
+ float clearcoat_ior = float(1.56) [[
350
+ anno::display_name("Clearcoat IOR"),
351
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
352
+ anno::in_group("Clearcoat"),
353
+ anno::soft_range(float(0.0), float(4.0))
354
+ ]],
355
+ uniform float clearcoat_bump_factor = float(1.0) [[
356
+ anno::display_name("Clearcoat Normal Map Strength"),
357
+ anno::description("Strength of normal map."),
358
+ anno::in_group("Clearcoat"),
359
+ anno::soft_range(float(0.0), float(1.0))
360
+ ]],
361
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[
362
+ anno::display_name("Clearcoat Normal Map"),
363
+ anno::description("Enables the usage of the normalmap texture"),
364
+ anno::in_group("Clearcoat"),
365
+ anno::usage("normal")
366
+ ]],
367
+ uniform float2 clearcoat_texture_translate = float2(0.0) [[
368
+ anno::display_name("Clearcoat Texture Translate"),
369
+ anno::description("Controls the position of the clearcoat texture"),
370
+ anno::ui_order(1),
371
+ anno::in_group("UV")
372
+ ]],
373
+ uniform float clearcoat_texture_rotate = float(0.0) [[
374
+ anno::display_name("Clearcoat Texture Rotate"),
375
+ anno::description("Rotates angle of the clearcoat texture in degrees"),
376
+ anno::ui_order(2),
377
+ anno::in_group("UV")
378
+ ]],
379
+ uniform float2 clearcoat_texture_scale = float2(1.0) [[
380
+ anno::display_name("Clearcoat Texture Tiling"),
381
+ anno::description("Controls the repetition of the clearcoat texture"),
382
+ anno::ui_order(3),
383
+ anno::in_group("UV")
384
+ ]],
385
+ float clearcoat_flatten = float(1.0) [[
386
+ anno::display_name("Clearcoat Flatten"),
387
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
388
+ anno::in_group("Clearcoat"),
389
+ anno::hard_range(float(0.0), float(1.0))
390
+ ]],
391
+
392
+
393
+ // Normal //
394
+
395
+ uniform float geometry_normal_roughness_strength = 1.f
396
+ [[
397
+ anno::hard_range(0.0, 1.0),
398
+ anno::display_name("Normal map to roughness weight"),
399
+ anno::description("Enables and weights roughness induced by normal maps"),
400
+ anno::in_group("Normal")
401
+ ]],
402
+ uniform float bump_factor = float(1.0) [[
403
+ anno::display_name("Normal Strength"),
404
+ anno::description("Strength of normal map"),
405
+ anno::in_group("Normal"),
406
+ anno::soft_range(float(0.0), float(1.0))
407
+ ]],
408
+ uniform texture_2d normalmap_texture = texture_2d() [[
409
+ anno::display_name("Normal Map"),
410
+ anno::in_group("Normal"),
411
+ anno::usage("normal")
412
+ ]],
413
+ uniform float detail_bump_factor = float(0.3) [[
414
+ anno::display_name("Detail Normal Strength"),
415
+ anno::in_group("Normal"),
416
+ anno::description("Strength of the detail normal"),
417
+ anno::soft_range(float(0.0), float(1.0))
418
+ ]],
419
+ uniform texture_2d detail_normalmap_texture = texture_2d() [[
420
+ anno::display_name("Detail Normal Map"),
421
+ anno::in_group("Normal"),
422
+ anno::usage("normal")
423
+ ]],
424
+ uniform bool flip_tangent_u = false [[
425
+ anno::display_name("Normal Map Flip U Tangent"),
426
+ anno::in_group("Normal")
427
+ ]],
428
+ uniform bool flip_tangent_v = true [[
429
+ anno::display_name("Normal Map Flip V Tangent"),
430
+ anno::in_group("Normal")
431
+ ]],
432
+
433
+
434
+ // UVW Projection Group //
435
+
436
+ uniform bool project_uvw = false [[
437
+ anno::display_name("Enable Project UVW Coordinates"),
438
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
439
+ anno::in_group("UV")
440
+ ]],
441
+ uniform bool world_or_object = false [[
442
+ anno::display_name("Enable World Space"),
443
+ anno::description("When enabled, uses world space for projection, otherwise object space is used"),
444
+ anno::in_group("UV"),
445
+ anno::enable_if("project_uvw == true")
446
+ ]],
447
+ uniform int uv_space_index = 0 [[
448
+ anno::display_name("UV Space Index"),
449
+ anno::description("UV Space Index"),
450
+ anno::in_group("UV"),
451
+ anno::enable_if("project_uvw == true"),
452
+ anno::hard_range(int(0), int(3))
453
+ ]],
454
+
455
+ // UVW Adjustments Group //
456
+
457
+ uniform float2 texture_translate = float2(0.0) [[
458
+ anno::display_name("Texture Translate"),
459
+ anno::description("Controls position of texture."),
460
+ anno::in_group("UV"),
461
+ anno::enable_if("project_uvw == true")
462
+ ]],
463
+ uniform float texture_rotate = float(0.0) [[
464
+ anno::display_name("Texture Rotate"),
465
+ anno::description("Rotates angle of texture in degrees."),
466
+ anno::in_group("UV"),
467
+ anno::enable_if("project_uvw == true")
468
+ ]],
469
+ uniform float2 texture_scale = float2(1.0) [[
470
+ anno::display_name("Texture Tiling"),
471
+ anno::description("Controls repetition of the texture."),
472
+ anno::in_group("UV"),
473
+ anno::enable_if("project_uvw == true")
474
+ ]],
475
+ uniform float2 detail_texture_translate = float2(0.0) [[
476
+ anno::display_name("Detail Texture Translate"),
477
+ anno::description("Controls the position of the detail texture."),
478
+ anno::in_group("UV"),
479
+ anno::enable_if("project_uvw == true")
480
+ ]],
481
+ uniform float detail_texture_rotate = float(0.0) [[
482
+ anno::display_name("Detail Texture Rotate"),
483
+ anno::description("Rotates angle of the detail texture in degrees."),
484
+ anno::in_group("UV"),
485
+ anno::enable_if("project_uvw == true")
486
+ ]],
487
+ uniform float2 detail_texture_scale = float2(1.0) [[
488
+ anno::display_name("Detail Texture Tiling"),
489
+ anno::description("Controls repetition of the detail texture."),
490
+ anno::in_group("UV"),
491
+ anno::enable_if("project_uvw == true")
492
+ ]]
493
+ )
494
+ [[
495
+ anno::display_name("OmniPBR ClearCoat "),
496
+ anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
497
+ anno::in_group("Base"),
498
+ anno::version( 2, 1, 1),
499
+ anno::author("NVIDIA CORPORATION"),
500
+ anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic"))
501
+ ]] = let {
502
+
503
+ // UVW lookup and transformation //
504
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
505
+
506
+ base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection(
507
+ coordinate_system: the_system,
508
+ texture_space: uv_space_index,
509
+ projection_type: base::projection_cubic
510
+ ) :
511
+ base::coordinate_source(
512
+ coordinate_system: base::texture_coordinate_uvw,
513
+ texture_space: uv_space_index
514
+ );
515
+
516
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
517
+ transform: rotation_translation_scale(
518
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
519
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
520
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
521
+ ),
522
+ coordinate: uvw
523
+ );
524
+
525
+ base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate(
526
+ transform: rotation_translation_scale(
527
+ scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0),
528
+ rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ),
529
+ translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0)
530
+ ),
531
+ coordinate: uvw
532
+ );
533
+
534
+ base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate(
535
+ transform: rotation_translation_scale(
536
+ scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0),
537
+ rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ),
538
+ translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f)
539
+ ),
540
+ coordinate: uvw
541
+ );
542
+
543
+ // Normal calculations //
544
+ OmniPBRBase_1::NormalData defaultData = OmniPBRBase_1::NormalData(state::normal(), float2(0));
545
+
546
+ OmniPBRBase_1::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ?
547
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
548
+ texture: normalmap_texture,
549
+ factor: bump_factor,
550
+ uvw: transformed_uvw,
551
+ flip_tangent_u: flip_tangent_u,
552
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
553
+ //flip_tangent_v: true
554
+
555
+ ) : defaultData;
556
+ float3 the_normal = normal_data.normal;
557
+
558
+ OmniPBRBase_1::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ?
559
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
560
+ texture: detail_normalmap_texture,
561
+ factor: detail_bump_factor,
562
+ uvw: detail_transformed_uvw,
563
+ flip_tangent_u: flip_tangent_u,
564
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
565
+ ) : defaultData;
566
+ float3 detail_normal = detail_normal_data.normal;
567
+
568
+ OmniPBRBase_1::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ?
569
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
570
+ texture: clearcoat_normalmap_texture,
571
+ factor: clearcoat_bump_factor,
572
+ uvw: clearcoat_transformed_uvw,
573
+ flip_tangent_u: flip_tangent_u,
574
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
575
+ ) : defaultData;
576
+ float3 clearcoat_normal = clearcoat_normal_data.normal;
577
+
578
+
579
+ float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal;
580
+ float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten);
581
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal)
582
+ : flattened_clearcoat_normal;
583
+
584
+
585
+ // ORM Handling //
586
+
587
+ float3 ORM_lookup = tex::lookup_float3(
588
+ tex: ORM_texture,
589
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
590
+ );
591
+
592
+
593
+ float3 roughness_lookup = tex::lookup_float3(
594
+ tex: reflectionroughness_texture,
595
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
596
+ );
597
+
598
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x;
599
+ float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
600
+ float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)),
601
+ math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y)));
602
+
603
+ 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)),
604
+ math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y)));
605
+
606
+ // Diffuse Color Lookup and AO //
607
+
608
+ base::texture_return base_lookup = base::file_texture(
609
+ texture: diffuse_texture,
610
+ color_offset: color(albedo_add),
611
+ color_scale: color(albedo_brightness),
612
+ mono_source: base::mono_luminance,
613
+ uvw: transformed_uvw,
614
+ clip: false
615
+ );
616
+
617
+ base::texture_return ao_lookup = base::file_texture(
618
+ texture: ao_texture,
619
+ color_offset: color(0.0, 0.0, 0.0),
620
+ color_scale: color(1.0, 1.0, 1.0),
621
+ mono_source: base::mono_average,
622
+ uvw: transformed_uvw,
623
+ clip: false
624
+ );
625
+
626
+
627
+ color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint;
628
+ color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation);
629
+ color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant;
630
+ color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint;
631
+
632
+ color base_color = multiply_colors(
633
+ color_1: tinted_diffuse,
634
+ color_2: ao_color,
635
+ weight: ao_to_diffuse
636
+ ).tint;
637
+
638
+
639
+ // Metalness //
640
+
641
+ float3 metallic_lookup = tex::lookup_float3(
642
+ tex: metallic_texture,
643
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
644
+ );
645
+
646
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x;
647
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
648
+
649
+
650
+ // Emission //
651
+
652
+ color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ?
653
+ base::file_texture(
654
+ texture: emissive_color_texture,
655
+ color_offset: color(0.0, 0.0, 0.0),
656
+ color_scale: color(1.0, 1.0, 1.0),
657
+ mono_source: base::mono_average,
658
+ uvw: transformed_uvw,
659
+ clip: false
660
+ ).tint : emissive_color;
661
+
662
+ color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ?
663
+ base::file_texture(
664
+ texture: emissive_mask_texture,
665
+ color_offset: color(0.0, 0.0, 0.0),
666
+ color_scale: color(1.0, 1.0, 1.0),
667
+ mono_source: base::mono_average,
668
+ uvw: transformed_uvw,
669
+ clip: false
670
+ ).tint : color(1.0);
671
+
672
+ color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0);
673
+
674
+ // Opacity //
675
+
676
+ float opacity_value = enable_opacity_texture ? base::file_texture(
677
+ texture: opacity_texture,
678
+ mono_source: opacity_mode,
679
+ uvw: transformed_uvw
680
+ ).mono : opacity_constant;
681
+
682
+ float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
683
+
684
+ material base = OmniPBRBase_1::OmniPBRBase(
685
+ diffuse_reflection_color: base_color,
686
+ specular_reflection_aniso_roughness: reflection_roughness,
687
+ specular_level: specular_level,
688
+ metalness: metallic,
689
+ enable_emission: enable_emission,
690
+ emission_color: final_emission_color,
691
+ emission_intensity: emissive_intensity,
692
+ enable_coat: enable_clearcoat,
693
+ coat_weight: clearcoat_weight,
694
+ coat_color: clearcoat_tint,
695
+ coat_transparency: clearcoat_transparency,
696
+ coat_aniso_roughness: clearcoat_reflection_roughness2,
697
+ coat_ior: clearcoat_ior,
698
+ enable_opacity: enable_opacity,
699
+ geometry_opacity: cutout_opacity,
700
+ clearcoat_geometry_normal: final_clearcoat_normal,
701
+ geometry_normal: diffuse_gloss_normal
702
+ );
703
+
704
+ } in material(
705
+ surface: base.surface,
706
+ geometry: base.geometry
707
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_ClearCoat_Opacity.mdl ADDED
@@ -0,0 +1,884 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+
30
+ mdl 1.7;
31
+ import ::df::*;
32
+ import ::state::*;
33
+ import ::math::*;
34
+ import ::base::*;
35
+ import ::tex::*;
36
+ import ::anno::*;
37
+
38
+ import ::nvidia::core_definitions::file_texture;
39
+ import ::nvidia::core_definitions::normalmap_texture;
40
+
41
+ import OmniPBRBase_1::*;
42
+
43
+
44
+ uniform float4x4 rotation_translation_scale(
45
+ uniform float3 rotation = float3(0.)
46
+ [[ anno::description("Rotation applied to every UVW coordinate") ]],
47
+ uniform float3 translation = float3(0.)
48
+ [[ anno::description("Offset applied to every UVW coordinate") ]],
49
+ uniform float3 scaling = float3(1.)
50
+ [[ anno::description("Scale applied to every UVW coordinate") ]]
51
+ )
52
+ [[
53
+ anno::description("Construct transformation matrix from Euler rotation, translation and scale"),
54
+ anno::hidden()
55
+ ]]
56
+ {
57
+ float4x4 scale =
58
+ float4x4(scaling.x , 0. , 0. , 0.,
59
+ 0. , scaling.y , 0. , 0.,
60
+ 0. , 0. , scaling.z , 0.,
61
+ translation.x, translation.y, translation.z, 1.);
62
+
63
+ float3 s = math::sin(rotation);
64
+ float3 c = math::cos(rotation);
65
+ float4x4 rotate =
66
+ 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,
67
+ 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,
68
+ -s.y , s.x*c.y , c.x*c.y , 0.0,
69
+ 0. , 0 , 0 , 1.);
70
+
71
+ return scale*rotate;
72
+ }
73
+
74
+ // Returns the normal n in tangent space, given n is in internal space.
75
+ float3 transform_internal_to_tangent(float3 n)
76
+ {
77
+ /* flip_tangent_v */
78
+ return
79
+ n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+
80
+ n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+
81
+ n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z);
82
+ }
83
+
84
+ // Returns the normal n in internal space, given n is in tangent space.
85
+ float3 transform_tangent_to_internal(float3 n)
86
+ {
87
+ return state::texture_tangent_u(0) * n.x -
88
+ state::texture_tangent_v(0) * n.y + /* flip_tangent_v */
89
+ state::normal() * n.z ;
90
+ }
91
+
92
+ // Returns a normal by adding a detail normal to a global normal.
93
+ export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
94
+ {
95
+ // http://blog.selfshadow.com/publications/blending-in-detail/
96
+ float3 n_t = transform_internal_to_tangent(n);
97
+ float3 nd_t = transform_internal_to_tangent(nd);
98
+
99
+ n_t=n_t + float3(0.,0.,1.);
100
+ nd_t = nd_t * float3(-1.,-1.,1.);
101
+
102
+ n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t;
103
+ return math::normalize(transform_tangent_to_internal(n));
104
+ }
105
+
106
+
107
+ base::texture_return multiply_colors(
108
+ color color_1 = color(1.0, 1.0, 1.0),
109
+ color color_2 = color(.5, .5, .5),
110
+ float weight = 1.0
111
+ ) [[
112
+ anno::hidden()
113
+ ]]
114
+ {
115
+ return base::blend_color_layers(
116
+ layers: base::color_layer[](
117
+ base::color_layer(
118
+ layer_color: color_2,
119
+ weight: weight,
120
+ mode: base::color_layer_multiply
121
+ )),
122
+ base: color_1
123
+ );
124
+ }
125
+
126
+
127
+ base::texture_return add_colors(
128
+ color color_1 = color(.5, .5, .5),
129
+ color color_2 = color(.5, .5, .5),
130
+ float weight = 1.0
131
+ ) [[
132
+ anno::hidden(),
133
+ anno::unused()
134
+ ]]
135
+ {
136
+ return base::blend_color_layers(
137
+ layers: base::color_layer[](
138
+ base::color_layer(
139
+ layer_color: color_2,
140
+ weight: weight,
141
+ mode: base::color_layer_add
142
+ )),
143
+ base: color_1
144
+ );
145
+ }
146
+
147
+ base::texture_return blend_colors(
148
+ color color_1 = color(1.0, 1.0, 1.0),
149
+ color color_2 = color(.5, .5, .5),
150
+ float weight = 1.0
151
+ ) [[
152
+ anno::hidden(),
153
+ anno::unused()
154
+ ]]
155
+ {
156
+ return base::blend_color_layers(
157
+ layers: base::color_layer[](
158
+ base::color_layer(
159
+ layer_color: color_2,
160
+ weight: weight,
161
+ mode: base::color_layer_blend
162
+ )),
163
+ base: color_1
164
+ );
165
+ }
166
+
167
+
168
+ export material OmniPBR_ClearCoat_Opacity(
169
+
170
+ color diffuse_color_constant = color(0.2f)
171
+ [[
172
+ anno::display_name("Base Color"),
173
+ anno::description("This is the base color"),
174
+ anno::in_group("Albedo")
175
+ ]],
176
+ uniform texture_2d diffuse_texture = texture_2d()
177
+ [[
178
+ anno::display_name("Albedo Map"),
179
+ anno::in_group("Albedo")
180
+ ]],
181
+ float albedo_desaturation = float(0.0)
182
+ [[
183
+ anno::display_name("Albedo Desaturation"),
184
+ anno::soft_range(float(0.0f), float(1.0f)),
185
+ anno::description("Desaturates the diffuse color"),
186
+ anno::in_group("Albedo")
187
+ ]],
188
+ float albedo_add = float(0.0)
189
+ [[
190
+ anno::display_name("Albedo Add"),
191
+ anno::soft_range(float(-1.0f), float(1.0f)),
192
+ anno::description("Adds a constant value to the diffuse color "),
193
+ anno::in_group("Albedo")
194
+ ]],
195
+ float albedo_brightness = float(1.0)
196
+ [[
197
+ anno::display_name("Albedo Brightness"),
198
+ anno::soft_range(float(0.0f), float(1.0f)),
199
+ anno::description("Multiplier for the diffuse color "),
200
+ anno::in_group("Albedo")
201
+ ]],
202
+ color diffuse_tint = color(1.0f)
203
+ [[
204
+ anno::display_name("Color Tint"),
205
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
206
+ anno::in_group("Albedo")
207
+ ]],
208
+
209
+
210
+ // -------------------- REFLECTIVITY ----------------------
211
+
212
+
213
+
214
+ float reflection_roughness_constant = 0.5f
215
+ [[
216
+ anno::display_name("Roughness Amount"),
217
+ anno::hard_range(0.0,1.),
218
+ anno::description("Higher roughness values lead to more blurry reflections"),
219
+ anno::in_group("Reflectivity")
220
+ ]],
221
+ float reflection_roughness_texture_influence = 0.0f
222
+ [[
223
+ anno::display_name("Roughness Map Influence"),
224
+ anno::hard_range(0.0, 1.),
225
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
226
+ anno::in_group("Reflectivity")
227
+ ]],
228
+ uniform texture_2d reflectionroughness_texture = texture_2d()
229
+ [[
230
+ anno::display_name("Roughness Map"),
231
+ anno::in_group("Reflectivity")
232
+ ]],
233
+
234
+
235
+ float metallic_constant = 0.f
236
+ [[
237
+ anno::display_name("Metallic Amount"),
238
+ anno::hard_range(0.0,1.),
239
+ anno::description("Metallic Material"),
240
+ anno::in_group("Reflectivity")
241
+ ]],
242
+ float metallic_texture_influence = 0.0f
243
+ [[
244
+ anno::display_name("Metallic Map Influence"),
245
+ anno::hard_range(0.0, 1.),
246
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
247
+ anno::in_group("Reflectivity")
248
+ ]],
249
+ uniform texture_2d metallic_texture = texture_2d()
250
+ [[
251
+ anno::display_name("Metallic Map"),
252
+ anno::in_group("Reflectivity")
253
+ ]],
254
+ float specular_level = float(0.5)
255
+ [[
256
+ anno::display_name("Specular"),
257
+ anno::soft_range(float(0.0f), float(1.0f)),
258
+ anno::description("The specular level (intensity) of the material"),
259
+ anno::in_group("Reflectivity")
260
+ ]],
261
+ // -------------------- ORM ----------------------
262
+ uniform bool enable_ORM_texture = false
263
+ [[
264
+ anno::display_name("Enable ORM Texture"),
265
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
266
+ anno::in_group("Reflectivity")
267
+ ]],
268
+ uniform texture_2d ORM_texture = texture_2d()
269
+ [[
270
+ anno::display_name("ORM Map"),
271
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
272
+ anno::in_group("Reflectivity")
273
+ ]],
274
+
275
+ // -------------------- AO Group ----------------------
276
+
277
+ float ao_to_diffuse = 0.0
278
+ [[
279
+ anno::display_name("AO to Diffuse"),
280
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
281
+ anno::in_group("AO"),
282
+ anno::hard_range(0.0f, 1.0f)
283
+ ]],
284
+ uniform texture_2d ao_texture = texture_2d()
285
+ [[
286
+ anno::display_name("Ambient Occlusion Map"),
287
+ anno::description("The Ambient Occlusion texture for the material"),
288
+ anno::in_group("AO")
289
+ ]],
290
+
291
+
292
+ // -------------------- EMISSIVE ----------------------
293
+
294
+
295
+ uniform bool enable_emission = false
296
+ [[
297
+ anno::display_name("Enable Emission"),
298
+ anno::description("Enables the emission of light from the material"),
299
+ anno::in_group("Emissive")
300
+ ]],
301
+
302
+ color emissive_color = color(1.0, 0.1, 0.1)
303
+ [[
304
+ anno::enable_if("enable_emission == true"),
305
+ anno::display_name("Emissive Color"),
306
+ anno::description("The emission color"),
307
+ anno::in_group("Emissive")
308
+
309
+ ]],
310
+
311
+ uniform texture_2d emissive_color_texture = texture_2d()
312
+ [[
313
+ anno::enable_if("enable_emission == true"),
314
+ anno::display_name("Emissive Color map"),
315
+ anno::in_group("Emissive"),
316
+ anno::description("The emissive color texture")
317
+ ]],
318
+
319
+ uniform texture_2d emissive_mask_texture = texture_2d()
320
+ [[
321
+ anno::enable_if("enable_emission == true"),
322
+ anno::display_name("Emissive Mask map"),
323
+ anno::description("The texture masking the emissive color"),
324
+ anno::in_group("Emissive")
325
+ ]],
326
+ uniform float emissive_intensity = 40.f
327
+ [[
328
+ anno::enable_if("enable_emission == true"),
329
+ anno::display_name("Emissive Intensity"),
330
+ anno::description("Intensity of the emission"),
331
+ anno::in_group("Emissive")
332
+ ]],
333
+
334
+ // Cutout Opacity
335
+ uniform bool enable_opacity = true
336
+ [[
337
+ anno::display_name("Enable Opacity"),
338
+ anno::description("Enables the use of cutout opacity"),
339
+ anno::in_group("Opacity")
340
+ ]],
341
+ uniform bool enable_opacity_texture = false
342
+ [[
343
+ anno::display_name("Enable Opacity Texture"),
344
+ anno::description("Enables or disables the usage of the opacity texture map"),
345
+ anno::in_group("Opacity")
346
+ ]],
347
+ uniform float opacity_constant = 1.f
348
+ [[
349
+ anno::hard_range(0.0, 1.0),
350
+ anno::display_name("Opacity Amount"),
351
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
352
+ anno::in_group("Opacity")
353
+ ]],
354
+ uniform texture_2d opacity_texture = texture_2d()
355
+ [[
356
+ anno::display_name("Opacity Map"),
357
+ anno::in_group("Opacity")
358
+ ]],
359
+ uniform base::mono_mode opacity_mode = base::mono_average
360
+ [[
361
+ anno::display_name("Opacity Mono Source"),
362
+ anno::in_group("Opacity"),
363
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum")
364
+ ]],
365
+ uniform float opacity_threshold = 0.f
366
+ [[
367
+ anno::hard_range(0.0, 1.0),
368
+ anno::display_name("Opacity Threshold"),
369
+ anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
370
+ anno::in_group("Opacity")
371
+ ]],
372
+
373
+ // -------------------- Clearcoat ----------------------
374
+ uniform bool enable_clearcoat = false
375
+ [[
376
+ anno::display_name("Enable Clearcoat Layer"),
377
+ anno::description("Adds a clearcoat layer on top of the material when enabled"),
378
+ anno::in_group("Clearcoat")
379
+ ]],
380
+ color clearcoat_tint = color(1.0f)
381
+ [[
382
+ anno::display_name("Clearcoat Tint"),
383
+ anno::description("Clearcoat is tinted and affects the underlying material"),
384
+ anno::in_group("Clearcoat")
385
+ ]],
386
+ float clearcoat_transparency = 1.0f
387
+ [[
388
+ anno::display_name("Clearcoat Transparency"),
389
+ anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
390
+ "covering the underlying layer"),
391
+ anno::in_group("Clearcoat"),
392
+ anno::hard_range(0.0f, 1.0f)
393
+ ]],
394
+ float clearcoat_reflection_roughness = 0.0f
395
+ [[
396
+ anno::display_name("Clearcoat Roughness"),
397
+ anno::description("Higher roughness values lead to more blurry reflections"),
398
+ anno::hard_range(0.0f, 1.0f),
399
+ anno::in_group("Clearcoat")
400
+ ]],
401
+ float clearcoat_weight = 1.0f
402
+ [[
403
+ anno::display_name("Clearcoat Weight"),
404
+ anno::description("Sets the weight for clearcoat layer"),
405
+ anno::hard_range(0.0f, 1.0f),
406
+ anno::in_group("Clearcoat")
407
+ ]],
408
+ float clearcoat_flatten = 1.0f
409
+ [[
410
+ anno::display_name("Clearcoat Flatten"),
411
+ anno::description("Flattens the clearcoat to even out the underlying bump maps"),
412
+ anno::hard_range(0.0f, 1.0f),
413
+ anno::in_group("Clearcoat")
414
+ ]],
415
+ float clearcoat_ior = 1.56f
416
+ [[
417
+ anno::display_name("Clearcoat IOR"),
418
+ anno::description("Sets the Index of refraction for the clearcoat layer"),
419
+ anno::soft_range(1.0f, 4.0f),
420
+ anno::in_group("Clearcoat")
421
+ ]],
422
+ uniform float clearcoat_bump_factor = 1.f
423
+ [[
424
+ anno::display_name("Clearcoat Normal Map Strength"),
425
+ anno::description("Strength of normal map."),
426
+ anno::in_group("Clearcoat"),
427
+ anno::soft_range(0.0f, 1.0f)
428
+ ]],
429
+ uniform texture_2d clearcoat_normalmap_texture = texture_2d()
430
+ [[
431
+ anno::display_name("Clearcoat Normal Map"),
432
+ anno::description("Enables the usage of the normalmap texture"),
433
+ anno::in_group("Clearcoat")
434
+ ]],
435
+
436
+ // -------------------- Normal ----------------------
437
+
438
+
439
+
440
+ uniform float geometry_normal_roughness_strength = 1.f
441
+ [[
442
+ anno::hard_range(0.0, 1.0),
443
+ anno::display_name("Normal map to roughness weight"),
444
+ anno::description("Enables and weights roughness induced by normal maps"),
445
+ anno::in_group("Normal")
446
+ ]],
447
+ /*
448
+ uniform bool enable_normalmap_texture = false
449
+ [[
450
+ anno::display_name("Enable Normal Texture"),
451
+ anno::description("Enables the usage of the normalmap texture"),
452
+ anno::in_group("Features")
453
+ ]],
454
+ */
455
+ uniform float bump_factor = 1.f
456
+ [[
457
+ anno::display_name("Normal Map Strength"),
458
+ anno::description("Strength of normal map."),
459
+ anno::in_group("Normal"),
460
+ anno::soft_range(0.0f, 1.0f)
461
+ ]],
462
+
463
+ uniform texture_2d normalmap_texture = texture_2d()
464
+ [[
465
+ anno::display_name("Normal Map"),
466
+ anno::description("Enables the usage of the normalmap texture"),
467
+ anno::in_group("Normal")
468
+ ]],
469
+
470
+
471
+
472
+ /* uniform bool enable_detail_normalmap_texture = false
473
+ [[
474
+ anno::display_name("Enable Detail Normal Texture"),
475
+ anno::in_group("Features"),
476
+ anno::description("Enables the usage of the detail normalmap texture")
477
+ ]],
478
+ */
479
+ uniform float detail_bump_factor = .3f
480
+ [[
481
+ anno::display_name("Detail Normal Strength"),
482
+ anno::in_group("Normal"),
483
+ anno::soft_range(0.0f, 1.0f),
484
+ anno::description("Strength of the detail normal")
485
+ ]],
486
+ uniform texture_2d detail_normalmap_texture = texture_2d()
487
+ [[
488
+ anno::display_name("Detail Normal Map"),
489
+ anno::in_group("Normal")
490
+ ]],
491
+ uniform bool flip_tangent_u = false [[
492
+ anno::display_name("Normal Map Flip U Tangent"),
493
+ anno::in_group("Normal")
494
+ ]],
495
+ uniform bool flip_tangent_v = true [[
496
+ anno::display_name("Normal Map Flip V Tangent"),
497
+ anno::in_group("Normal")
498
+ ]],
499
+
500
+ // UV Projection Group
501
+ uniform bool project_uvw = false
502
+ [[
503
+ anno::display_name("Enable Project UVW Coordinates"),
504
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
505
+ anno::in_group("UV")
506
+ ]],
507
+ uniform bool world_or_object = false
508
+ [[
509
+ anno::enable_if("project_uvw == true"),
510
+ anno::display_name("Enable World Space"),
511
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
512
+ anno::in_group("UV")
513
+ ]],
514
+
515
+ uniform int uv_space_index = 0
516
+ [[
517
+ anno::enable_if("project_uvw == true"),
518
+ anno::display_name("UV Space Index"),
519
+ anno::description("UV Space Index."),
520
+ anno::in_group("UV"),
521
+ anno::hard_range(0, 3)
522
+ ]],
523
+
524
+ // Adjustments Group
525
+ uniform float2 texture_translate = float2(0.0f)
526
+ [[
527
+ anno::enable_if("project_uvw == true"),
528
+ anno::display_name("Texture Translate"),
529
+ anno::description("Controls position of texture."),
530
+ anno::in_group("UV")
531
+ ]],
532
+ uniform float texture_rotate = 0.f
533
+ [[
534
+ anno::enable_if("project_uvw == true"),
535
+ anno::display_name("Texture Rotate"),
536
+ anno::description("Rotates angle of texture in degrees."),
537
+ anno::in_group("UV")
538
+ ]],
539
+ uniform float2 texture_scale = float2(1.0f)
540
+ [[
541
+ anno::enable_if("project_uvw == true"),
542
+ anno::display_name("Texture Scale"),
543
+ anno::description("Larger number increases size of texture."),
544
+ anno::in_group("UV")
545
+ ]],
546
+
547
+ uniform float2 detail_texture_translate = float2(0.0f)
548
+ [[
549
+ anno::enable_if("project_uvw == true"),
550
+ anno::display_name("Detail Texture Translate"),
551
+ anno::description("Controls the position of the detail texture."),
552
+ anno::in_group("UV")
553
+ ]],
554
+ uniform float detail_texture_rotate = 0.f
555
+ [[
556
+ anno::enable_if("project_uvw == true"),
557
+ anno::display_name("Detail Texture Rotate"),
558
+ anno::description("Rotates angle of the detail texture in degrees."),
559
+ anno::in_group("UV")
560
+ ]],
561
+ uniform float2 detail_texture_scale = float2(1.0f)
562
+ [[
563
+ anno::enable_if("project_uvw == true"),
564
+ anno::display_name("Detail Texture Scale"),
565
+ anno::description("Larger numbers increase the size of the detail texture"),
566
+ anno::in_group("UV")
567
+ ]],
568
+
569
+ uniform float2 clearcoat_texture_translate = float2(0.0f)
570
+ [[
571
+ anno::display_name("Clearcoat Texture Translate"),
572
+ anno::description("Controls the position of the detail texture."),
573
+ anno::in_group("UV")
574
+ ]],
575
+ uniform float clearcoat_texture_rotate = 0.f
576
+ [[
577
+ anno::display_name("Clearcoat Texture Rotate"),
578
+ anno::description("Rotates angle of the detail texture in degrees."),
579
+ anno::in_group("UV")
580
+ ]],
581
+ uniform float2 clearcoat_texture_scale = float2(1.0f)
582
+ [[
583
+ anno::display_name("Clearcoat Texture Scale"),
584
+ anno::description("Larger numbers increase the size of the detail texture"),
585
+ anno::in_group("UV")
586
+ ]]
587
+
588
+ )
589
+ [[
590
+ anno::display_name("OmniPBR ClearCoat Opacity"),
591
+ anno::description("OmniPBR with ClearCoat. Supports opacity and ORM textures."),
592
+ anno::in_group("Base"),
593
+ anno::version( 2, 1, 0),
594
+ anno::author("NVIDIA CORPORATION"),
595
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
596
+ ]]
597
+ = let{
598
+
599
+ // UVW lookup and transformation
600
+ base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
601
+
602
+
603
+ base::texture_coordinate_info uvw = project_uvw ?
604
+ base::coordinate_projection(
605
+ coordinate_system: the_system,
606
+ texture_space: uv_space_index,
607
+ projection_type: base::projection_cubic ) :
608
+ base::coordinate_source(
609
+ coordinate_system: base::texture_coordinate_uvw,
610
+ texture_space: uv_space_index
611
+ );
612
+
613
+
614
+ base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
615
+ transform: rotation_translation_scale(
616
+ scaling: float3(texture_scale.x, texture_scale.y, 1.0),
617
+ rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
618
+ translation: float3(texture_translate.x, texture_translate.y, 0.0)
619
+ ),
620
+ coordinate: uvw
621
+ );
622
+
623
+
624
+ base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate(
625
+ transform: rotation_translation_scale(
626
+ scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0),
627
+ rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ),
628
+ translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0)
629
+ ),
630
+ coordinate: uvw
631
+ );
632
+
633
+ base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate(
634
+ transform: rotation_translation_scale(
635
+ scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0),
636
+ rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ),
637
+ translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f)
638
+ ),
639
+ coordinate: uvw
640
+ );
641
+
642
+ // Normal calculations
643
+ OmniPBRBase_1::NormalData defaultData = OmniPBRBase_1::NormalData(state::normal(), float2(0));
644
+
645
+ OmniPBRBase_1::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ?
646
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
647
+ texture: normalmap_texture,
648
+ factor: bump_factor,
649
+ uvw: transformed_uvw,
650
+ flip_tangent_u: flip_tangent_u,
651
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
652
+ //flip_tangent_v: true
653
+
654
+ ) : defaultData;
655
+ float3 the_normal = normal_data.normal;
656
+
657
+ OmniPBRBase_1::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ?
658
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
659
+ texture: detail_normalmap_texture,
660
+ factor: detail_bump_factor,
661
+ uvw: detail_transformed_uvw,
662
+ flip_tangent_u: flip_tangent_u,
663
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
664
+ ) : defaultData;
665
+ float3 detail_normal = detail_normal_data.normal;
666
+
667
+ OmniPBRBase_1::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ?
668
+ OmniPBRBase_1::tangent_space_normal_roughness_texture(
669
+ texture: clearcoat_normalmap_texture,
670
+ factor: clearcoat_bump_factor,
671
+ uvw: clearcoat_transformed_uvw,
672
+ flip_tangent_u: flip_tangent_u,
673
+ flip_tangent_v: flip_tangent_v // true for dx, false for opengl
674
+ ) : defaultData;
675
+ float3 clearcoat_normal = clearcoat_normal_data.normal;
676
+
677
+ float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal;
678
+
679
+ float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten);
680
+
681
+ float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal) : flattened_clearcoat_normal;
682
+
683
+
684
+ // -------------------- ORM Handling --------------------
685
+ float3 ORM_lookup = tex::lookup_float3(
686
+ tex: ORM_texture,
687
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
688
+ );
689
+
690
+ float3 roughness_lookup = tex::lookup_float3(
691
+ tex: reflectionroughness_texture,
692
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
693
+ );
694
+
695
+ float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x;
696
+
697
+ float reflection_roughness_1 = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
698
+
699
+
700
+ // Diffuse Color Lookup and AO
701
+
702
+ base::texture_return base_lookup = base::file_texture(
703
+ texture: diffuse_texture,
704
+ color_offset: color(albedo_add),
705
+ color_scale: color(albedo_brightness),
706
+ mono_source: base::mono_luminance,
707
+ uvw: transformed_uvw,
708
+ clip: false
709
+ );
710
+
711
+ base::texture_return ao_lookup = base::file_texture(
712
+ texture: ao_texture,
713
+ color_offset: color(0.0, 0.0, 0.0),
714
+ color_scale: color(1.0, 1.0, 1.0),
715
+ mono_source: base::mono_average,
716
+ uvw: transformed_uvw,
717
+ clip: false
718
+ );
719
+
720
+ // checking whether the ORM texture or the AO texture is supposed to be used
721
+ color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint;
722
+
723
+ color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation);
724
+
725
+ color diffuse_color = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant;
726
+
727
+ //color diffuse_color = desaturated_base ;
728
+
729
+ color tinted_diffuse_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint ;
730
+
731
+ color base_color = multiply_colors(
732
+ color_1: tinted_diffuse_color,
733
+ color_2: ao_color,
734
+ weight: ao_to_diffuse
735
+ ).tint;
736
+
737
+ float3 metallic_lookup = tex::lookup_float3(
738
+ tex: metallic_texture,
739
+ coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
740
+ );
741
+
742
+ // Choose between ORM or metallic map
743
+ float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x;
744
+
745
+ // blend between the constant metallic value and the map lookup
746
+ float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
747
+
748
+
749
+ bsdf diffuse_bsdf = df::weighted_layer(
750
+ weight: 1.0,
751
+ layer: df::diffuse_reflection_bsdf(
752
+ tint: base_color,
753
+ roughness: 0.f ),
754
+ base: bsdf(),
755
+ normal: enable_clearcoat ? diffuse_gloss_normal : state::normal()
756
+ );
757
+
758
+ // The glossy reflection BSDF
759
+ // TODO: Clearcoat's induced roughness from normal map should also apply here, but right now avoiding it due to confusing relationship in the normals
760
+ bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
761
+ roughness_u:reflection_roughness_1 * reflection_roughness_1 + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x),
762
+ roughness_v:reflection_roughness_1 * reflection_roughness_1 + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y),
763
+ tint: color(1.0, 1.0, 1.0),
764
+ mode: df::scatter_reflect
765
+ );
766
+
767
+
768
+ bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
769
+ normal_reflectivity: 0.08,
770
+ grazing_reflectivity: 1.0,
771
+ exponent: 5.0,
772
+ weight: specular_level,
773
+ layer: ggx_smith_bsdf,
774
+ base: diffuse_bsdf,
775
+ normal: enable_clearcoat ? diffuse_gloss_normal : state::normal()
776
+ );
777
+
778
+ // Replaced by tinting as this reproduces the UE4 behavior more faithfully
779
+ // bsdf directional_factor_bsdf = df::directional_factor(
780
+ // normal_tint: base_color,
781
+ // grazing_tint: base_color, //color(1.0, 1.0, 1.0),
782
+ // exponent: 3.0f,
783
+ // base: ggx_smith_bsdf
784
+ // );
785
+
786
+ bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
787
+
788
+
789
+ // CLEARCOAT
790
+
791
+
792
+ bsdf omni_PBR_bsdf = df::weighted_layer(
793
+ weight: metallic,
794
+ layer: directional_factor_bsdf,
795
+ base: custom_curve_layer_bsdf,
796
+ normal: enable_clearcoat ? diffuse_gloss_normal : state::normal()
797
+ );
798
+
799
+ bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
800
+ roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x),
801
+ roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y),
802
+ tint: color(1.0f),
803
+ mode: df::scatter_reflect
804
+ );
805
+
806
+ // bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
807
+ // normal_reflectivity: clearcoat_reflectivity * 0.08,
808
+ // grazing_reflectivity: 1.0,
809
+ // weight: clearcoat_weight,
810
+ // layer: clearcoat_bsdf,
811
+ // base: omni_PBR_bsdf,
812
+ // normal: final_clearcoat_normal
813
+ // );
814
+
815
+ bsdf opaque_clearcoat = df::weighted_layer(
816
+ weight: clearcoat_transparency,
817
+ layer: ::df::tint(
818
+ tint: clearcoat_tint,
819
+ base: omni_PBR_bsdf),
820
+ base: ::df::diffuse_reflection_bsdf(
821
+ tint: clearcoat_tint)
822
+ );
823
+
824
+ bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
825
+ ior: clearcoat_ior,
826
+ weight: clearcoat_weight,
827
+ layer: clearcoat_bsdf,
828
+ base: opaque_clearcoat,
829
+ normal: final_clearcoat_normal
830
+ );
831
+
832
+
833
+ bsdf final_bsdf = enable_clearcoat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
834
+
835
+ // Emission
836
+ color emissive_color_tx = tex::texture_isvalid(emissive_color_texture) ?
837
+ base::file_texture(
838
+ texture: emissive_color_texture,
839
+ color_offset: color(0.0, 0.0, 0.0),
840
+ color_scale: color(1.0, 1.0, 1.0),
841
+ mono_source: base::mono_average,
842
+ uvw: transformed_uvw,
843
+ clip: false
844
+ ).tint : emissive_color;
845
+
846
+ color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
847
+ base::file_texture(
848
+ texture: emissive_mask_texture,
849
+ color_offset: color(0.0, 0.0, 0.0),
850
+ color_scale: color(1.0, 1.0, 1.0),
851
+ mono_source: base::mono_average,
852
+ uvw: transformed_uvw,
853
+ clip: false
854
+ ).tint : color(1.0);
855
+
856
+ float opacity_value = enable_opacity_texture ? base::file_texture(
857
+ texture: opacity_texture,
858
+ mono_source: opacity_mode,
859
+ uvw: transformed_uvw
860
+ ).mono : opacity_constant;
861
+
862
+ // The opacity_threshold is interpreted as follows:
863
+ // 1. opacity_threshold > 0: binary opacity masking mode
864
+ // i.e.: if opacity_value > opacity_threshold we remap opacity_value to 1.0, otherwise to 0.0
865
+ // 2. opacity_threshold == 0: fractional opacity mode. Leaves the opacity_value untouched,
866
+ // allowing the renderer to use fractional cutout_opacity values, if it supports this feature
867
+ //
868
+ // NOTE: when the renderer does not enable 'fractional cutout opacity' it interprets
869
+ // cutout_opacity values of 1.0 as opaque and anything below as fully transparent
870
+ float local_cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
871
+
872
+ } in material(
873
+ surface: material_surface(
874
+ scattering: final_bsdf,
875
+ emission: material_emission (
876
+ df::diffuse_edf(),
877
+ intensity: enable_emission? emissive_color_tx * emissive_mask * color(emissive_intensity) : color(0)
878
+ )
879
+ ),
880
+ geometry: material_geometry(
881
+ normal: enable_clearcoat ? state::normal() : diffuse_gloss_normal,
882
+ cutout_opacity: local_cutout_opacity
883
+ )
884
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniPBR_Opacity.mdl ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+ mdl 1.4;
29
+
30
+ import ::base::*;
31
+ import ::anno::*;
32
+
33
+ using OmniPBR_ClearCoat_Opacity import OmniPBR_ClearCoat_Opacity;
34
+
35
+
36
+
37
+ export material OmniPBR_Opacity(
38
+
39
+ color diffuse_color_constant = color(0.2f)
40
+ [[
41
+ anno::display_name("Base Color"),
42
+ anno::description("This is the base color"),
43
+ anno::in_group("Albedo")
44
+ ]],
45
+ uniform texture_2d diffuse_texture = texture_2d()
46
+ [[
47
+ anno::display_name("Albedo Map"),
48
+ anno::in_group("Albedo")
49
+ ]],
50
+ float albedo_desaturation = float(0.0)
51
+ [[
52
+ anno::display_name("Albedo Desaturation"),
53
+ anno::soft_range(float(0.0f), float(1.0f)),
54
+ anno::description("Desaturates the diffuse color"),
55
+ anno::in_group("Albedo")
56
+ ]],
57
+ float albedo_add = float(0.0)
58
+ [[
59
+ anno::display_name("Albedo Add"),
60
+ anno::soft_range(float(-1.0f), float(1.0f)),
61
+ anno::description("Adds a constant value to the diffuse color "),
62
+ anno::in_group("Albedo")
63
+ ]],
64
+ float albedo_brightness = float(1.0)
65
+ [[
66
+ anno::display_name("Albedo Brightness"),
67
+ anno::soft_range(float(0.0f), float(1.0f)),
68
+ anno::description("Multiplier for the diffuse color "),
69
+ anno::in_group("Albedo")
70
+ ]],
71
+ color diffuse_tint = color(1.0f)
72
+ [[
73
+ anno::display_name("Color Tint"),
74
+ anno::description("When enabled, this color value is multiplied over the final albedo color"),
75
+ anno::in_group("Albedo")
76
+ ]],
77
+
78
+
79
+ // -------------------- REFLECTIVITY ----------------------
80
+
81
+
82
+
83
+ float reflection_roughness_constant = 0.5f
84
+ [[
85
+ anno::display_name("Roughness Amount"),
86
+ anno::hard_range(0.0,1.),
87
+ anno::description("Higher roughness values lead to more blurry reflections"),
88
+ anno::in_group("Reflectivity")
89
+ ]],
90
+ float reflection_roughness_texture_influence = 0.0f
91
+ [[
92
+ anno::display_name("Roughness Map Influence"),
93
+ anno::hard_range(0.0, 1.),
94
+ anno::description("Blends between the constant value and the lookup of the roughness texture"),
95
+ anno::in_group("Reflectivity")
96
+ ]],
97
+ uniform texture_2d reflectionroughness_texture = texture_2d()
98
+ [[
99
+ anno::display_name("Roughness Map"),
100
+ anno::in_group("Reflectivity")
101
+ ]],
102
+
103
+
104
+ float metallic_constant = 0.f
105
+ [[
106
+ anno::display_name("Metallic Amount"),
107
+ anno::hard_range(0.0,1.),
108
+ anno::description("Metallic Material"),
109
+ anno::in_group("Reflectivity")
110
+ ]],
111
+ float metallic_texture_influence = 0.0f
112
+ [[
113
+ anno::display_name("Metallic Map Influence"),
114
+ anno::hard_range(0.0, 1.),
115
+ anno::description("Blends between the constant value and the lookup of the metallic texture"),
116
+ anno::in_group("Reflectivity")
117
+ ]],
118
+ uniform texture_2d metallic_texture = texture_2d()
119
+ [[
120
+ anno::display_name("Metallic Map"),
121
+ anno::in_group("Reflectivity")
122
+ ]],
123
+ float specular_level = float(0.5)
124
+ [[
125
+ anno::display_name("Specular"),
126
+ anno::soft_range(float(0.0f), float(1.0f)),
127
+ anno::description("The specular level (intensity) of the material"),
128
+ anno::in_group("Reflectivity")
129
+ ]],
130
+ // -------------------- ORM ----------------------
131
+ uniform bool enable_ORM_texture = false
132
+ [[
133
+ anno::display_name("Enable ORM Texture"),
134
+ anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
135
+ anno::in_group("Reflectivity")
136
+ ]],
137
+ uniform texture_2d ORM_texture = texture_2d()
138
+ [[
139
+ anno::display_name("ORM Map"),
140
+ anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
141
+ anno::in_group("Reflectivity")
142
+ ]],
143
+
144
+ // -------------------- AO Group ----------------------
145
+
146
+ float ao_to_diffuse = 0.0
147
+ [[
148
+ anno::display_name("AO to Diffuse"),
149
+ anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
150
+ anno::in_group("AO"),
151
+ anno::hard_range(0.0f, 1.0f)
152
+ ]],
153
+ uniform texture_2d ao_texture = texture_2d()
154
+ [[
155
+ anno::display_name("Ambient Occlusion Map"),
156
+ anno::description("The Ambient Occlusion texture for the material"),
157
+ anno::in_group("AO")
158
+ ]],
159
+
160
+
161
+ // -------------------- EMISSIVE ----------------------
162
+
163
+
164
+ uniform bool enable_emission = false
165
+ [[
166
+ anno::display_name("Enable Emission"),
167
+ anno::description("Enables the emission of light from the material"),
168
+ anno::in_group("Emissive")
169
+ ]],
170
+
171
+ color emissive_color = color(1.0, 0.1, 0.1)
172
+ [[
173
+ anno::enable_if("enable_emission == true"),
174
+ anno::display_name("Emissive Color"),
175
+ anno::description("The emission color"),
176
+ anno::in_group("Emissive")
177
+
178
+ ]],
179
+ uniform texture_2d emissive_color_texture = texture_2d()
180
+ [[
181
+ anno::enable_if("enable_emission == true"),
182
+ anno::display_name("Emissive Color map"),
183
+ anno::in_group("Emissive"),
184
+ anno::description("The emissive color texture")
185
+ ]],
186
+ uniform texture_2d emissive_mask_texture = texture_2d()
187
+ [[
188
+ anno::enable_if("enable_emission == true"),
189
+ anno::display_name("Emissive Mask map"),
190
+ anno::description("The texture masking the emissive color"),
191
+ anno::in_group("Emissive")
192
+ ]],
193
+ uniform float emissive_intensity = 40.f
194
+ [[
195
+ anno::enable_if("enable_emission == true"),
196
+ anno::display_name("Emissive Intensity"),
197
+ anno::description("Intensity of the emission"),
198
+ anno::in_group("Emissive")
199
+ ]],
200
+
201
+ // Cutout Opacity
202
+ uniform bool enable_opacity = true
203
+ [[
204
+ anno::display_name("Enable Opacity"),
205
+ anno::description("Enables the use of cutout opacity"),
206
+ anno::in_group("Opacity")
207
+ ]],
208
+ uniform bool enable_opacity_texture = false
209
+ [[
210
+ anno::display_name("Enable Opacity Texture"),
211
+ anno::description("Enables or disables the usage of the opacity texture map"),
212
+ anno::in_group("Opacity")
213
+ ]],
214
+ uniform float opacity_constant = 1.f
215
+ [[
216
+ anno::hard_range(0.0, 1.0),
217
+ anno::display_name("Opacity Amount"),
218
+ anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
219
+ anno::in_group("Opacity")
220
+ ]],
221
+ uniform texture_2d opacity_texture = texture_2d()
222
+ [[
223
+ anno::display_name("Opacity Map"),
224
+ anno::in_group("Opacity")
225
+ ]],
226
+ uniform base::mono_mode opacity_mode = base::mono_average
227
+ [[
228
+ anno::display_name("Opacity Mono Source"),
229
+ anno::in_group("Opacity"),
230
+ anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum")
231
+ ]],
232
+ uniform float opacity_threshold = 0.f
233
+ [[
234
+ anno::hard_range(0.0, 1.0),
235
+ anno::display_name("Opacity Threshold"),
236
+ 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"),
237
+ anno::in_group("Opacity")
238
+ ]],
239
+
240
+ // -------------------- Normal ----------------------
241
+
242
+
243
+
244
+ /*
245
+ uniform bool enable_normalmap_texture = false
246
+ [[
247
+ anno::display_name("Enable Normal Texture"),
248
+ anno::description("Enables the usage of the normalmap texture"),
249
+ anno::in_group("Features")
250
+ ]],
251
+ */
252
+ uniform float bump_factor = 1.f
253
+ [[
254
+ anno::display_name("Normal Map Strength"),
255
+ anno::description("Strength of normal map."),
256
+ anno::in_group("Normal"),
257
+ anno::soft_range(0.0f, 1.0f)
258
+ ]],
259
+
260
+ uniform texture_2d normalmap_texture = texture_2d()
261
+ [[
262
+ anno::display_name("Normal Map"),
263
+ anno::description("Enables the usage of the normalmap texture"),
264
+ anno::in_group("Normal")
265
+ ]],
266
+
267
+
268
+
269
+ /* uniform bool enable_detail_normalmap_texture = false
270
+ [[
271
+ anno::display_name("Enable Detail Normal Texture"),
272
+ anno::in_group("Features"),
273
+ anno::description("Enables the usage of the detail normalmap texture")
274
+ ]],
275
+ */
276
+ uniform float detail_bump_factor = .3f
277
+ [[
278
+ anno::display_name("Detail Normal Strength"),
279
+ anno::in_group("Normal"),
280
+ anno::soft_range(0.0f, 1.0f),
281
+ anno::description("Strength of the detail normal")
282
+ ]],
283
+ uniform texture_2d detail_normalmap_texture = texture_2d()
284
+ [[
285
+ anno::display_name("Detail Normal Map"),
286
+ anno::in_group("Normal")
287
+ ]],
288
+ // UV Projection Group
289
+ uniform bool project_uvw = false
290
+ [[
291
+ anno::display_name("Enable Project UVW Coordinates"),
292
+ anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
293
+ anno::in_group("UV")
294
+ ]],
295
+ uniform bool world_or_object = false
296
+ [[
297
+ anno::enable_if("project_uvw == true"),
298
+ anno::display_name("Enable World Space"),
299
+ anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
300
+ anno::in_group("UV")
301
+ ]],
302
+
303
+ uniform int uv_space_index = 0
304
+ [[
305
+ anno::enable_if("project_uvw == true"),
306
+ anno::display_name("UV Space Index"),
307
+ anno::description("UV Space Index."),
308
+ anno::in_group("UV"),
309
+ anno::hard_range(0, 3)
310
+ ]],
311
+
312
+ // Adjustments Group
313
+ uniform float2 texture_translate = float2(0.0f)
314
+ [[
315
+ anno::enable_if("project_uvw == true"),
316
+ anno::display_name("Texture Translate"),
317
+ anno::description("Controls position of texture."),
318
+ anno::in_group("UV")
319
+ ]],
320
+ uniform float texture_rotate = 0.f
321
+ [[
322
+ anno::enable_if("project_uvw == true"),
323
+ anno::display_name("Texture Rotate"),
324
+ anno::description("Rotates angle of texture in degrees."),
325
+ anno::in_group("UV")
326
+ ]],
327
+ uniform float2 texture_scale = float2(1.0f)
328
+ [[
329
+ anno::enable_if("project_uvw == true"),
330
+ anno::display_name("Texture Scale"),
331
+ anno::description("Larger number increases size of texture."),
332
+ anno::in_group("UV")
333
+ ]],
334
+
335
+ uniform float2 detail_texture_translate = float2(0.0f)
336
+ [[
337
+ anno::enable_if("project_uvw == true"),
338
+ anno::display_name("Detail Texture Translate"),
339
+ anno::description("Controls the position of the detail texture."),
340
+ anno::in_group("UV")
341
+ ]],
342
+ uniform float detail_texture_rotate = 0.f
343
+ [[
344
+ anno::enable_if("project_uvw == true"),
345
+ anno::display_name("Detail Texture Rotate"),
346
+ anno::description("Rotates angle of the detail texture in degrees."),
347
+ anno::in_group("UV")
348
+ ]],
349
+ uniform float2 detail_texture_scale = float2(1.0f)
350
+ [[
351
+ anno::enable_if("project_uvw == true"),
352
+ anno::display_name("Detail Texture Scale"),
353
+ anno::description("Larger numbers increase the size of the detail texture"),
354
+ anno::in_group("UV")
355
+ ]]
356
+ )
357
+ [[
358
+ anno::display_name("OmniPBR Opacity"),
359
+ anno::description("OmniPBR supports opacity and ORM textures"),
360
+ anno::in_group("Base"),
361
+ anno::version( 2, 1, 0),
362
+ anno::author("NVIDIA CORPORATION"),
363
+ anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
364
+ ]]
365
+ = OmniPBR_ClearCoat_Opacity(
366
+ diffuse_texture: diffuse_texture,
367
+ albedo_desaturation: albedo_desaturation,
368
+ albedo_add: albedo_add,
369
+ albedo_brightness: albedo_brightness,
370
+ diffuse_color_constant: diffuse_color_constant,
371
+ diffuse_tint: diffuse_tint,
372
+ //ao
373
+ ao_texture: ao_texture,
374
+ ao_to_diffuse: ao_to_diffuse,
375
+ //ORM
376
+ ORM_texture: ORM_texture,
377
+ enable_ORM_texture: enable_ORM_texture,
378
+ //reflectivity
379
+ reflection_roughness_constant: reflection_roughness_constant,
380
+ reflectionroughness_texture: reflectionroughness_texture,
381
+ reflection_roughness_texture_influence: reflection_roughness_texture_influence,
382
+ metallic_constant: metallic_constant,
383
+ metallic_texture: metallic_texture,
384
+ metallic_texture_influence: metallic_texture_influence,
385
+ specular_level: specular_level,
386
+ //opacity
387
+ enable_opacity: enable_opacity,
388
+ enable_opacity_texture: enable_opacity_texture,
389
+ opacity_texture: opacity_texture,
390
+ opacity_constant: opacity_constant,
391
+ opacity_mode: opacity_mode,
392
+ opacity_threshold: opacity_threshold,
393
+ //emissive
394
+ enable_emission: enable_emission,
395
+ emissive_color: emissive_color,
396
+ emissive_color_texture: emissive_color_texture,
397
+ emissive_mask_texture: emissive_mask_texture,
398
+ emissive_intensity: emissive_intensity,
399
+ //clearcoat
400
+ enable_clearcoat: false,
401
+ clearcoat_tint: color(1.0f),
402
+ clearcoat_transparency: 1.0f,
403
+ clearcoat_reflection_roughness: 0.0f,
404
+ clearcoat_weight: 1.0f,
405
+ clearcoat_flatten: 1.0f,
406
+ clearcoat_ior: 1.56f,
407
+ clearcoat_bump_factor: 1.f,
408
+ clearcoat_normalmap_texture: texture_2d(),
409
+ //normal
410
+ normalmap_texture: normalmap_texture,
411
+ bump_factor: bump_factor,
412
+ detail_normalmap_texture: detail_normalmap_texture,
413
+ detail_bump_factor: detail_bump_factor,
414
+ project_uvw: project_uvw,
415
+ world_or_object: world_or_object,
416
+ uv_space_index: uv_space_index,
417
+ texture_translate: texture_translate,
418
+ texture_rotate: texture_rotate,
419
+ texture_scale: texture_scale,
420
+ detail_texture_translate: detail_texture_translate,
421
+ detail_texture_rotate: detail_texture_rotate,
422
+ detail_texture_scale: detail_texture_scale,
423
+ clearcoat_texture_translate: float2(0.0f),
424
+ clearcoat_texture_rotate: 0.0f,
425
+ clearcoat_texture_scale: float2(1.0f)
426
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurface.mdl ADDED
@@ -0,0 +1,1688 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ // Wrapper for OmniSurfaceBase material
30
+
31
+ mdl 1.7;
32
+
33
+ import ::anno::*;
34
+ import ::base::*;
35
+ import ::limits::*;
36
+ import ::state::*;
37
+ import ::tex::*;
38
+
39
+ import ::OmniSurface::OmniSurfaceBase::*;
40
+ import ::OmniSurface::OmniShared::*;
41
+ import ::OmniSurface::OmniImage::*;
42
+
43
+ export material OmniSurface(
44
+
45
+ //Diffuse reflection
46
+ //
47
+ float diffuse_reflection_weight = float(0.8) [[
48
+ anno::display_name("Weight"),
49
+ anno::in_group("Base"),
50
+ anno::hard_range(0.0f, 1.0f)
51
+ ]],
52
+
53
+ uniform texture_2d diffuse_reflection_weight_image = texture_2d() [[
54
+ anno::display_name("Weight Image"),
55
+ anno::in_group("Base"),
56
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
57
+ ]],
58
+
59
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_weight_image_alpha_mode =
60
+ ::OmniSurface::OmniImage::alpha_default [[
61
+ anno::display_name("Weight Image Alpha Mode"),
62
+ anno::in_group("Base")
63
+ ]],
64
+
65
+ color diffuse_reflection_color = color(1.0) [[
66
+ anno::display_name("Color"),
67
+ anno::in_group("Base")
68
+ ]],
69
+
70
+ uniform texture_2d diffuse_reflection_color_image = texture_2d() [[
71
+ anno::display_name("Color Image"),
72
+ anno::in_group("Base")
73
+ ]],
74
+
75
+ float diffuse_reflection_roughness = float(0.0) [[
76
+ anno::display_name("Diffuse Roughness"),
77
+ anno::in_group("Base"),
78
+ anno::hard_range(0.0f, 1.0f)
79
+ ]],
80
+
81
+ uniform texture_2d diffuse_reflection_roughness_image = texture_2d() [[
82
+ anno::display_name("Diffuse Roughness Image"),
83
+ anno::in_group("Base"),
84
+ anno::usage("roughness")
85
+ ]],
86
+
87
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_roughness_image_alpha_mode =
88
+ ::OmniSurface::OmniImage::alpha_default [[
89
+ anno::display_name("Diffuse Roughness Alpha Mode"),
90
+ anno::in_group("Base")
91
+ ]],
92
+
93
+ //Metal
94
+ //
95
+ float metalness = float(0.0) [[
96
+ anno::display_name("Metalness"),
97
+ anno::in_group("Base"),
98
+ anno::hard_range(0.0f, 1.0f)
99
+ ]],
100
+
101
+ uniform texture_2d metalness_image = texture_2d() [[
102
+ anno::display_name("Metalness Image"),
103
+ anno::in_group("Base"),
104
+ anno::usage("metalness")
105
+ ]],
106
+
107
+ uniform ::OmniSurface::OmniImage::alpha_mode metalness_image_alpha_mode =
108
+ ::OmniSurface::OmniImage::alpha_default [[
109
+ anno::display_name("Metalness Image Alpha Mode"),
110
+ anno::in_group("Base")
111
+ ]],
112
+
113
+ //Specular reflection
114
+ //
115
+ float specular_reflection_weight = float(1.0) [[
116
+ anno::display_name("Weight"),
117
+ anno::in_group("Specular"),
118
+ anno::hard_range(0.0f, 1.0f)
119
+ ]],
120
+
121
+ uniform texture_2d specular_reflection_weight_image = texture_2d() [[
122
+ anno::display_name("Weight Image"),
123
+ anno::in_group("Specular"),
124
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
125
+ ]],
126
+
127
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_weight_image_alpha_mode =
128
+ ::OmniSurface::OmniImage::alpha_default [[
129
+ anno::display_name("Weight Image Alpha Mode"),
130
+ anno::in_group("Specular")
131
+ ]],
132
+
133
+ color specular_reflection_color = color(1.0) [[
134
+ anno::display_name("Color"),
135
+ anno::in_group("Specular")
136
+ ]],
137
+
138
+ uniform texture_2d specular_reflection_color_image = texture_2d() [[
139
+ anno::display_name("Color Image"),
140
+ anno::in_group("Specular")
141
+ ]],
142
+
143
+ float specular_reflection_roughness = float(0.2) [[
144
+ anno::display_name("Roughness"),
145
+ anno::in_group("Specular"),
146
+ anno::hard_range(0.0f, 1.0f)
147
+ ]],
148
+
149
+ uniform texture_2d specular_reflection_roughness_image = texture_2d() [[
150
+ anno::display_name("Roughness Image"),
151
+ anno::in_group("Specular"),
152
+ anno::usage("roughness")
153
+ ]],
154
+
155
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_roughness_image_alpha_mode =
156
+ ::OmniSurface::OmniImage::alpha_default [[
157
+ anno::display_name("Roughness Image Alpha Mode"),
158
+ anno::in_group("Specular")
159
+ ]],
160
+
161
+ uniform ::OmniSurface::OmniShared::ior_presets specular_reflection_ior_preset =
162
+ ::OmniSurface::OmniShared::ior_custom [[
163
+ anno::display_name("IOR Preset"),
164
+ anno::in_group("Specular")
165
+ ]],
166
+
167
+ uniform float specular_reflection_ior = float(1.5) [[
168
+ anno::display_name("IOR"),
169
+ anno::in_group("Specular"),
170
+ anno::soft_range(1.0f, 5.0f),
171
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
172
+ ]],
173
+
174
+ float specular_reflection_anisotropy = float(0.0) [[
175
+ anno::display_name("Anisotropy"),
176
+ anno::in_group("Specular"),
177
+ anno::hard_range(0.0f, 1.0f)
178
+ ]],
179
+
180
+ uniform texture_2d specular_reflection_anisotropy_image = texture_2d() [[
181
+ anno::display_name("Anisotropy Image"),
182
+ anno::in_group("Specular"),
183
+ anno::usage("anisotropy")
184
+ ]],
185
+
186
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_image_alpha_mode =
187
+ ::OmniSurface::OmniImage::alpha_default [[
188
+ anno::display_name("Anisotropy Image Alpha Mode"),
189
+ anno::in_group("Specular")
190
+ ]],
191
+
192
+ float specular_reflection_anisotropy_rotation = float(0.0) [[
193
+ anno::display_name("Rotation (radian)"),
194
+ anno::in_group("Specular"),
195
+ anno::soft_range(0.0f, 1.0f)
196
+ ]],
197
+
198
+ uniform texture_2d specular_reflection_anisotropy_rotation_image = texture_2d() [[
199
+ anno::display_name("Anisotropy Rotation Image"),
200
+ anno::in_group("Specular"),
201
+ anno::usage("anisotropy_rotation")
202
+ ]],
203
+
204
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_rotation_image_alpha_mode =
205
+ ::OmniSurface::OmniImage::alpha_default [[
206
+ anno::display_name("Anisotropy Rotation Alpha Mode"),
207
+ anno::in_group("Specular")
208
+ ]],
209
+
210
+ //Specular transmission
211
+ //
212
+ uniform bool enable_specular_transmission = false [[
213
+ anno::display_name("Enable Transmission"),
214
+ anno::description("Enables the use of transmission"),
215
+ anno::in_group("Transmission")
216
+ ]],
217
+
218
+ float specular_transmission_weight = float(0.0) [[
219
+ anno::display_name("Weight"),
220
+ anno::in_group("Transmission"),
221
+ anno::hard_range(0.0f, 1.0f)
222
+ ]],
223
+
224
+ uniform texture_2d specular_transmission_weight_image = texture_2d() [[
225
+ anno::display_name("Weight Image"),
226
+ anno::in_group("Transmission"),
227
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
228
+ ]],
229
+
230
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_transmission_weight_image_alpha_mode =
231
+ ::OmniSurface::OmniImage::alpha_default [[
232
+ anno::display_name("Weight Image Alpha Mode"),
233
+ anno::in_group("Transmission")
234
+ ]],
235
+
236
+ color specular_transmission_color = color(1.0) [[
237
+ anno::display_name("Color"),
238
+ anno::in_group("Transmission")
239
+ ]],
240
+
241
+ uniform texture_2d specular_transmission_color_image = texture_2d() [[
242
+ anno::display_name("Color Image"),
243
+ anno::in_group("Transmission")
244
+ ]],
245
+
246
+ float specular_transmission_scattering_depth = float(0.0) [[
247
+ anno::display_name("Depth"),
248
+ anno::in_group("Transmission"),
249
+ anno::soft_range(0.0f, 100.0f),
250
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
251
+ ]],
252
+
253
+ uniform texture_2d specular_transmission_scattering_depth_image = texture_2d() [[
254
+ anno::display_name("Depth Image"),
255
+ anno::in_group("Transmission"),
256
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
257
+ ]],
258
+
259
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_transmission_scattering_depth_image_alpha_mode =
260
+ ::OmniSurface::OmniImage::alpha_default [[
261
+ anno::display_name("Depth Image Alpha Mode"),
262
+ anno::in_group("Transmission")
263
+ ]],
264
+
265
+ color specular_transmission_scattering_color = color(0.0) [[
266
+ anno::display_name("Scatter"),
267
+ anno::in_group("Transmission")
268
+ ]],
269
+
270
+ uniform texture_2d specular_transmission_scattering_color_image = texture_2d() [[
271
+ anno::display_name("Scatter Image"),
272
+ anno::in_group("Transmission")
273
+ ]],
274
+
275
+ float specular_transmission_scatter_anisotropy = float(0.0) [[
276
+ anno::display_name("Scatter Anisotropy"),
277
+ anno::in_group("Transmission"),
278
+ anno::hard_range(-1.0f, 1.0f)
279
+ ]],
280
+
281
+ uniform texture_2d specular_transmission_scatter_anisotropy_image = texture_2d() [[
282
+ anno::display_name("Scatter Anisotropy Image"),
283
+ anno::in_group("Transmission")
284
+ ]],
285
+
286
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_transmission_scatter_anisotropy_image_alpha_mode =
287
+ ::OmniSurface::OmniImage::alpha_default [[
288
+ anno::display_name("Scatter Anisotropy Image Alpha Mode"),
289
+ anno::in_group("Transmission")
290
+ ]],
291
+
292
+ uniform float specular_transmission_dispersion_abbe = float(0.0) [[
293
+ anno::display_name("Dispersion Abbe"),
294
+ anno::in_group("Transmission"),
295
+ anno::soft_range(0.0f, 100.0f),
296
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
297
+ ]],
298
+
299
+ //Subsurface
300
+ //
301
+ uniform bool enable_diffuse_transmission = false [[
302
+ anno::display_name("Enable Subsurface"),
303
+ anno::description("Enables the use of subsurface"),
304
+ anno::in_group("Subsurface")
305
+ ]],
306
+
307
+ float subsurface_weight = float(0.0) [[
308
+ anno::display_name("Weight"),
309
+ anno::in_group("Subsurface"),
310
+ anno::hard_range(0.0f, 1.0f)
311
+ ]],
312
+
313
+ uniform texture_2d subsurface_weight_image = texture_2d() [[
314
+ anno::display_name("Weight Image"),
315
+ anno::in_group("Subsurface"),
316
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
317
+ ]],
318
+
319
+ uniform ::OmniSurface::OmniImage::alpha_mode subsurface_weight_image_alpha_mode =
320
+ ::OmniSurface::OmniImage::alpha_default [[
321
+ anno::display_name("Weight Image Alpha Mode"),
322
+ anno::in_group("Subsurface")
323
+ ]],
324
+
325
+ uniform ::OmniSurface::OmniShared::scattering_colors_presets subsurface_scattering_colors_preset =
326
+ ::OmniSurface::OmniShared::scattering_colors_custom [[
327
+ anno::display_name("Scattering Presets"),
328
+ anno::in_group("Subsurface")
329
+ ]],
330
+
331
+ color subsurface_transmission_color = color(1.0) [[
332
+ anno::display_name("Color"),
333
+ anno::in_group("Subsurface")
334
+ ]],
335
+
336
+ uniform texture_2d subsurface_transmission_color_image = texture_2d() [[
337
+ anno::display_name("Color Image"),
338
+ anno::in_group("Subsurface")
339
+ ]],
340
+
341
+ color subsurface_scattering_color = color(1.0) [[
342
+ anno::display_name("Radius (mfp)"),
343
+ anno::in_group("Subsurface")
344
+ ]],
345
+
346
+ uniform texture_2d subsurface_scattering_color_image = texture_2d() [[
347
+ anno::display_name("Radius Image"),
348
+ anno::in_group("Subsurface")
349
+ ]],
350
+
351
+ float subsurface_scale = float(1.0) [[
352
+ anno::display_name("Scale"),
353
+ anno::in_group("Subsurface"),
354
+ anno::soft_range(0.0f, 10.0f),
355
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
356
+ ]],
357
+
358
+ uniform texture_2d subsurface_scale_image = texture_2d() [[
359
+ anno::display_name("Scale Image"),
360
+ anno::in_group("Subsurface"),
361
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
362
+ ]],
363
+
364
+ uniform ::OmniSurface::OmniImage::alpha_mode subsurface_scale_image_alpha_mode =
365
+ ::OmniSurface::OmniImage::alpha_default [[
366
+ anno::display_name("Scale Image Alpha Mode"),
367
+ anno::in_group("Subsurface")
368
+ ]],
369
+
370
+ float subsurface_anisotropy = float(0.0) [[
371
+ anno::display_name("Anisotropy"),
372
+ anno::in_group("Subsurface"),
373
+ anno::hard_range(-1.0f, 1.0f)
374
+ ]],
375
+
376
+ uniform texture_2d subsurface_anisotropy_image = texture_2d() [[
377
+ anno::display_name("Anisotropy Image"),
378
+ anno::in_group("Subsurface"),
379
+ anno::usage("anisotropy")
380
+ ]],
381
+
382
+ uniform ::OmniSurface::OmniImage::alpha_mode subsurface_anisotropy_image_alpha_mode =
383
+ ::OmniSurface::OmniImage::alpha_default [[
384
+ anno::display_name("Anisotropy Image Alpha Mode"),
385
+ anno::in_group("Subsurface")
386
+ ]],
387
+
388
+ //Coat
389
+ //
390
+ float coat_weight = float(0.0) [[
391
+ anno::display_name("Weight"),
392
+ anno::in_group("Coat"),
393
+ anno::hard_range(0.0f, 1.0f)
394
+ ]],
395
+
396
+ uniform texture_2d coat_weight_image = texture_2d() [[
397
+ anno::display_name("Weight Image"),
398
+ anno::in_group("Coat"),
399
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
400
+ ]],
401
+
402
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_weight_image_alpha_mode =
403
+ ::OmniSurface::OmniImage::alpha_default [[
404
+ anno::display_name("Weight Image Alpha Mode"),
405
+ anno::in_group("Coat")
406
+ ]],
407
+
408
+ color coat_color = color(1.0) [[
409
+ anno::display_name("Color"),
410
+ anno::in_group("Coat")
411
+ ]],
412
+
413
+ uniform texture_2d coat_color_image = texture_2d() [[
414
+ anno::display_name("Color Image"),
415
+ anno::in_group("Coat")
416
+ ]],
417
+
418
+ float coat_roughness = float(0.1) [[
419
+ anno::display_name("Roughness"),
420
+ anno::in_group("Coat"),
421
+ anno::hard_range(0.0f, 1.0f)
422
+ ]],
423
+
424
+ uniform texture_2d coat_roughness_image = texture_2d() [[
425
+ anno::display_name("Roughness Image"),
426
+ anno::in_group("Coat"),
427
+ anno::usage("roughness")
428
+ ]],
429
+
430
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_roughness_image_alpha_mode =
431
+ ::OmniSurface::OmniImage::alpha_default [[
432
+ anno::display_name("Roughness Image Alpha Mode"),
433
+ anno::in_group("Coat")
434
+ ]],
435
+
436
+ uniform ::OmniSurface::OmniShared::ior_presets coat_ior_preset =
437
+ ::OmniSurface::OmniShared::ior_custom [[
438
+ anno::display_name("IOR Preset"),
439
+ anno::in_group("Coat")
440
+ ]],
441
+
442
+ uniform float coat_ior = float(1.5) [[
443
+ anno::display_name("IOR"),
444
+ anno::in_group("Coat"),
445
+ anno::soft_range(1.0f, 5.0f),
446
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
447
+ ]],
448
+
449
+ float coat_anisotropy = float(0.0) [[
450
+ anno::display_name("Anisotropy"),
451
+ anno::in_group("Coat"),
452
+ anno::hard_range(0.0f, 1.0f)
453
+ ]],
454
+
455
+ uniform texture_2d coat_anisotropy_image = texture_2d() [[
456
+ anno::display_name("Anisotropy Image"),
457
+ anno::in_group("Coat"),
458
+ anno::usage("anisotropy")
459
+ ]],
460
+
461
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_image_alpha_mode =
462
+ ::OmniSurface::OmniImage::alpha_default [[
463
+ anno::display_name("Anisotropy Image Alpha Mode"),
464
+ anno::in_group("Coat")
465
+ ]],
466
+
467
+ float coat_anisotropy_rotation = float(0.0) [[
468
+ anno::display_name("Rotation (radian)"),
469
+ anno::in_group("Coat"),
470
+ anno::soft_range(0.0f, 1.0f)
471
+ ]],
472
+
473
+ uniform texture_2d coat_anisotropy_rotation_image = texture_2d() [[
474
+ anno::display_name("Anisotropy Rotation Image"),
475
+ anno::in_group("Coat"),
476
+ anno::usage("anisotropy_rotation")
477
+ ]],
478
+
479
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_rotation_image_alpha_mode =
480
+ ::OmniSurface::OmniImage::alpha_default [[
481
+ anno::display_name("Anisotropy Rotation Image Alpha Mode"),
482
+ anno::in_group("Coat")
483
+ ]],
484
+
485
+ float coat_affect_color = float(0.0) [[
486
+ anno::display_name("Affect Color"),
487
+ anno::in_group("Coat"),
488
+ anno::hard_range(0.0f, 1.0f)
489
+ ]],
490
+
491
+ uniform texture_2d coat_affect_color_image = texture_2d() [[
492
+ anno::display_name("Affect Color Image"),
493
+ anno::in_group("Coat")
494
+ ]],
495
+
496
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_color_image_alpha_mode =
497
+ ::OmniSurface::OmniImage::alpha_default [[
498
+ anno::display_name("Affect Color Image Alpha Mode"),
499
+ anno::in_group("Coat")
500
+ ]],
501
+
502
+ float coat_affect_roughness = float(0.0) [[
503
+ anno::display_name("Affect Roughness"),
504
+ anno::in_group("Coat"),
505
+ anno::hard_range(0.0f, 1.0f)
506
+ ]],
507
+
508
+ uniform texture_2d coat_affect_roughness_image = texture_2d() [[
509
+ anno::display_name("Affect Roughness Image"),
510
+ anno::in_group("Coat"),
511
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
512
+ ]],
513
+
514
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_roughness_image_alpha_mode =
515
+ ::OmniSurface::OmniImage::alpha_default [[
516
+ anno::display_name("Affect Roughness Alpha Mode"),
517
+ anno::in_group("Coat")
518
+ ]],
519
+
520
+ uniform float coat_normal_strength = float(1.0) [[
521
+ anno::display_name("Normal Strength"),
522
+ anno::in_group("Coat"),
523
+ anno::soft_range(0.0f, 1.0f),
524
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
525
+ ]],
526
+
527
+ float3 coat_normal = state::normal() [[
528
+ anno::display_name("Normal"),
529
+ anno::in_group("Coat"),
530
+ anno::usage("normal")
531
+ ]],
532
+
533
+ uniform texture_2d coat_normal_image = texture_2d() [[
534
+ anno::display_name("Normal Map Image"),
535
+ anno::in_group("Coat"),
536
+ anno::usage("normal")
537
+ ]],
538
+
539
+ uniform bool coat_normal_image_flip_r_channel = false [[
540
+ anno::display_name("Normal Map Flip R Channel"),
541
+ anno::in_group("Coat")
542
+ ]],
543
+
544
+ uniform bool coat_normal_image_flip_g_channel = false [[
545
+ anno::display_name("Normal Map Flip G Channel"),
546
+ anno::in_group("Coat")
547
+ ]],
548
+
549
+ uniform bool coat_normal_image_flip_b_channel = false [[
550
+ anno::display_name("Normal Map Flip B Channel"),
551
+ anno::in_group("Coat")
552
+ ]],
553
+
554
+ //Specular retro-reflection
555
+ //
556
+ float specular_retro_reflection_weight = float(0.0) [[
557
+ anno::display_name("Weight"),
558
+ anno::in_group("Sheen"),
559
+ anno::hard_range(0.0f, 1.0f)
560
+ ]],
561
+
562
+ uniform texture_2d specular_retro_reflection_weight_image = texture_2d() [[
563
+ anno::display_name("Weight Image"),
564
+ anno::in_group("Sheen"),
565
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
566
+ ]],
567
+
568
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_retro_reflection_weight_image_alpha_mode =
569
+ ::OmniSurface::OmniImage::alpha_default [[
570
+ anno::display_name("Weight Image Alpha Mode"),
571
+ anno::in_group("Sheen")
572
+ ]],
573
+
574
+ color specular_retro_reflection_color = color(1.0) [[
575
+ anno::display_name("Color"),
576
+ anno::in_group("Sheen")
577
+ ]],
578
+
579
+ uniform texture_2d specular_retro_reflection_color_image = texture_2d() [[
580
+ anno::display_name("Color Image"),
581
+ anno::in_group("Sheen")
582
+ ]],
583
+
584
+ float specular_retro_reflection_roughness = float(0.3) [[
585
+ anno::display_name("Roughness"),
586
+ anno::in_group("Sheen"),
587
+ anno::hard_range(0.0f, 1.0f)
588
+ ]],
589
+
590
+ uniform texture_2d specular_retro_reflection_roughness_image = texture_2d() [[
591
+ anno::display_name("Roughness Image"),
592
+ anno::in_group("Sheen"),
593
+ anno::usage("roughness")
594
+ ]],
595
+
596
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_retro_reflection_roughness_image_alpha_mode =
597
+ ::OmniSurface::OmniImage::alpha_default [[
598
+ anno::display_name("Roughness Image Alpha Mode"),
599
+ anno::in_group("Sheen")
600
+ ]],
601
+
602
+ //Emission
603
+ //
604
+ float emission_weight = float(0.0) [[
605
+ anno::display_name("Weight"),
606
+ anno::in_group("Emission"),
607
+ anno::hard_range(0.0f, 1.0f)
608
+ ]],
609
+
610
+ uniform texture_2d emission_weight_image = texture_2d() [[
611
+ anno::display_name("Weight Image"),
612
+ anno::in_group("Emission"),
613
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
614
+ ]],
615
+
616
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_weight_image_alpha_mode =
617
+ ::OmniSurface::OmniImage::alpha_default [[
618
+ anno::display_name("Weight Image Alpha Mode"),
619
+ anno::in_group("Emission")
620
+ ]],
621
+
622
+ uniform ::OmniSurface::OmniShared::emission_mode emission_mode =
623
+ ::OmniSurface::OmniShared::emission_lx [[
624
+ anno::display_name("Emission Mode"),
625
+ anno::in_group("Emission")
626
+ ]],
627
+
628
+ float emission_intensity = float(1.0) [[
629
+ anno::display_name("Intensity"),
630
+ anno::in_group("Emission"),
631
+ anno::soft_range(0.0f, 1000.0f)
632
+ ]],
633
+
634
+ uniform texture_2d emission_intensity_image = texture_2d() [[
635
+ anno::display_name("Intensity Image"),
636
+ anno::in_group("Emission"),
637
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
638
+ ]],
639
+
640
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_intensity_image_alpha_mode =
641
+ ::OmniSurface::OmniImage::alpha_default [[
642
+ anno::display_name("Intensity Image Alpha Mode"),
643
+ anno::in_group("Emission")
644
+ ]],
645
+
646
+ color emission_color = color(1.0) [[
647
+ anno::display_name("Color"),
648
+ anno::in_group("Emission")
649
+ ]],
650
+
651
+ uniform texture_2d emission_color_image = texture_2d() [[
652
+ anno::display_name("Color Image"),
653
+ anno::in_group("Emission")
654
+ ]],
655
+
656
+ uniform bool emission_use_temperature = false [[
657
+ anno::display_name("Use Temperature"),
658
+ anno::in_group("Emission")
659
+ ]],
660
+
661
+ float emission_temperature = float(6500.0) [[
662
+ anno::display_name("Temperature (kelvin)"),
663
+ anno::in_group("Emission"),
664
+ anno::soft_range(0.0f, 10000.0f)
665
+ ]],
666
+
667
+ uniform texture_2d emission_temperature_image = texture_2d() [[
668
+ anno::display_name("Temperature Image"),
669
+ anno::in_group("Emission"),
670
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
671
+ ]],
672
+
673
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_temperature_image_alpha_mode =
674
+ ::OmniSurface::OmniImage::alpha_default [[
675
+ anno::display_name("Temperature Image Alpha Mode"),
676
+ anno::in_group("Emission")
677
+ ]],
678
+
679
+ //Thin Film
680
+ //
681
+ uniform bool enable_thin_film = false [[
682
+ anno::display_name("Enable Thin Film"),
683
+ anno::description("Enable the use of thin film"),
684
+ anno::in_group("Thin Film")
685
+ ]],
686
+
687
+ float thin_film_thickness = float(400.0) [[
688
+ anno::display_name("Thickness (nm)"),
689
+ anno::in_group("Thin Film"),
690
+ anno::soft_range(0.0f, 2000.0f),
691
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
692
+ ]],
693
+
694
+ uniform texture_2d thin_film_thickness_image = texture_2d() [[
695
+ anno::display_name("Thickness Image"),
696
+ anno::in_group("Thin Film"),
697
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
698
+ ]],
699
+
700
+ uniform ::OmniSurface::OmniImage::alpha_mode thin_film_thickness_image_alpha_mode =
701
+ ::OmniSurface::OmniImage::alpha_default [[
702
+ anno::display_name("Thickness Image Alpha Mode"),
703
+ anno::in_group("Thin Film")
704
+ ]],
705
+
706
+ uniform ::OmniSurface::OmniShared::ior_presets thin_film_ior_preset =
707
+ ::OmniSurface::OmniShared::ior_custom [[
708
+ anno::display_name("IOR Preset"),
709
+ anno::in_group("Thin Film")
710
+ ]],
711
+
712
+ uniform float thin_film_ior = float(1.5) [[
713
+ anno::display_name("IOR"),
714
+ anno::in_group("Thin Film"),
715
+ anno::soft_range(1.0f, 3.0f),
716
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
717
+ ]],
718
+
719
+ //Geometry
720
+ //
721
+ uniform bool thin_walled = false [[
722
+ anno::display_name("Thin Walled"),
723
+ anno::description("Thin surface with no interior."),
724
+ anno::in_group("Geometry")
725
+ ]],
726
+
727
+ uniform bool enable_opacity = false [[
728
+ anno::display_name("Enable Opacity"),
729
+ anno::description("Enables the use of cutout opacity"),
730
+ anno::in_group("Geometry")
731
+ ]],
732
+
733
+ float geometry_opacity = float(1.0) [[
734
+ anno::display_name("Opacity"),
735
+ anno::in_group("Geometry"),
736
+ anno::hard_range(0.0f, 1.0f)
737
+ ]],
738
+
739
+ uniform texture_2d geometry_opacity_image = texture_2d() [[
740
+ anno::display_name("Opacity Image"),
741
+ anno::in_group("Geometry"),
742
+ anno::usage("opacity")
743
+ ]],
744
+
745
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_opacity_image_alpha_mode =
746
+ ::OmniSurface::OmniImage::alpha_default [[
747
+ anno::display_name("Opacity Image Alpha Mode"),
748
+ anno::in_group("Geometry")
749
+ ]],
750
+
751
+ uniform float geometry_opacity_threshold = float(0.0) [[
752
+ anno::display_name("Opacity Threshold"),
753
+ anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
754
+ anno::in_group("Geometry"),
755
+ anno::hard_range(0.0f, 1.0f)
756
+ ]],
757
+
758
+ uniform float geometry_normal_strength = float(1.0) [[
759
+ anno::display_name("Geometry Normal Strength"),
760
+ anno::in_group("Geometry"),
761
+ anno::soft_range(0.0f, 1.0f),
762
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
763
+ ]],
764
+
765
+ uniform float geometry_normal_roughness_strength = float(1.0) [[
766
+ anno::display_name("Geometry Normal Roughness Strength"),
767
+ anno::in_group("Geometry"),
768
+ anno::hard_range(0.0f, 1.0f)
769
+ ]],
770
+
771
+ float3 geometry_normal = state::normal() [[
772
+ anno::display_name("Geometry Normal"),
773
+ anno::in_group("Geometry"),
774
+ anno::usage("normal")
775
+ ]],
776
+
777
+ uniform texture_2d geometry_normal_image = texture_2d() [[
778
+ anno::display_name("Geometry Normal Map Image"),
779
+ anno::in_group("Geometry"),
780
+ anno::usage("normal")
781
+ ]],
782
+
783
+ uniform bool geometry_normal_image_flip_r_channel = false [[
784
+ anno::display_name("Normal Map Flip R Channel"),
785
+ anno::in_group("Geometry")
786
+ ]],
787
+
788
+ uniform bool geometry_normal_image_flip_g_channel = false [[
789
+ anno::display_name("Normal Map Flip G Channel"),
790
+ anno::in_group("Geometry")
791
+ ]],
792
+
793
+ uniform bool geometry_normal_image_flip_b_channel = false [[
794
+ anno::display_name("Normal Map Flip B Channel"),
795
+ anno::in_group("Geometry")
796
+ ]],
797
+
798
+ uniform ::OmniSurface::OmniImage::tangent_bitangent_mapping geometry_tangent_bitangent_mapping =
799
+ ::OmniSurface::OmniImage::red_green [[
800
+ anno::display_name("Tangent Bitangent Mapping"),
801
+ anno::in_group("Geometry")
802
+ ]],
803
+
804
+ //Displacement
805
+ float3 geometry_displacement = float3(0.0) [[
806
+ anno::display_name("Displacement"),
807
+ anno::in_group("Geometry")
808
+ ]],
809
+
810
+ uniform ::OmniSurface::OmniShared::displacement_mode geometry_displacement_mode =
811
+ ::OmniSurface::OmniShared::displacement_height [[
812
+ anno::display_name("Displacement Mode"),
813
+ anno::in_group("Geometry")
814
+ ]],
815
+
816
+ uniform texture_2d geometry_displacement_image = texture_2d() [[
817
+ anno::display_name("Displacement Image"),
818
+ anno::in_group("Geometry"),
819
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
820
+ ]],
821
+
822
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_image_alpha_mode =
823
+ ::OmniSurface::OmniImage::alpha_default [[
824
+ anno::display_name("Displacement Image Alpha Mode"),
825
+ anno::in_group("Geometry")
826
+ ]],
827
+
828
+ float geometry_displacement_scale = float(1.0) [[
829
+ anno::display_name("Displacement Scale"),
830
+ anno::in_group("Geometry"),
831
+ anno::soft_range(0.0f, 1.0f)
832
+ ]],
833
+
834
+ uniform texture_2d geometry_displacement_scale_image = texture_2d() [[
835
+ anno::display_name("Displacement Scale Image"),
836
+ anno::in_group("Geometry"),
837
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
838
+ ]],
839
+
840
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_scale_image_alpha_mode =
841
+ ::OmniSurface::OmniImage::alpha_default [[
842
+ anno::display_name("Displacement Scale Image Alpha Mode"),
843
+ anno::in_group("Geometry")
844
+ ]],
845
+
846
+ float geometry_displacement_scalar_zero_value = float(0.0) [[
847
+ anno::display_name("Displacement Scalar Zero Value"),
848
+ anno::in_group("Geometry"),
849
+ anno::soft_range(0.0f, 1.0f)
850
+ ]],
851
+
852
+ //UVW
853
+ //
854
+ uniform base::texture_coordinate_system uvw_texture_coordinate_system =
855
+ base::texture_coordinate_uvw [[
856
+ anno::display_name("Texture Coordinate"),
857
+ anno::in_group("UVW Coordinates")
858
+ ]],
859
+
860
+ uniform int uvw_uv_set = 0 [[
861
+ anno::display_name("UV Set"),
862
+ anno::in_group("UVW Coordinates"),
863
+ anno::hard_range(0, 4)
864
+ ]],
865
+
866
+ uniform bool uvw_ignore_missing_textures = false [[
867
+ anno::display_name("Ignore Missing Images"),
868
+ anno::in_group("UVW Coordinates")
869
+ ]],
870
+
871
+ color uvw_missing_texture_color = color(0.0, 0.0, 0.0) [[
872
+ anno::display_name("Missing Image Color"),
873
+ anno::in_group("UVW Coordinates")
874
+ ]],
875
+
876
+ uniform bool uvw_use_uv_coords = false [[
877
+ anno::display_name("Use UV Coords"),
878
+ anno::in_group("UVW Coordinates")
879
+ ]],
880
+
881
+ float2 uvw_uv_coords = float2(0.0) [[
882
+ anno::display_name("UV Coords"),
883
+ anno::in_group("UVW Coordinates")
884
+ ]],
885
+
886
+ uniform float uvw_s_offset = 0.0f [[
887
+ anno::display_name("Offset U"),
888
+ anno::in_group("UVW Coordinates"),
889
+ anno::soft_range(-1.0f, 1.0f)
890
+ ]],
891
+
892
+ uniform float uvw_t_offset = 0.0f [[
893
+ anno::display_name("Offset V"),
894
+ anno::in_group("UVW Coordinates"),
895
+ anno::soft_range(-1.0f, 1.0f)
896
+ ]],
897
+
898
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_s_wrap =
899
+ ::OmniSurface::OmniImage::wrap_periodic [[
900
+ anno::display_name("Wrap U"),
901
+ anno::in_group("UVW Coordinates")
902
+ ]],
903
+
904
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_t_wrap =
905
+ ::OmniSurface::OmniImage::wrap_periodic [[
906
+ anno::display_name("Wrap V"),
907
+ anno::in_group("UVW Coordinates")
908
+ ]],
909
+
910
+ uniform float uvw_s_scale = 1.0f [[
911
+ anno::display_name("Scale U"),
912
+ anno::in_group("UVW Coordinates"),
913
+ anno::soft_range(0.0f, 100.0f)
914
+ ]],
915
+
916
+ uniform float uvw_t_scale = 1.0f [[
917
+ anno::display_name("Scale V"),
918
+ anno::in_group("UVW Coordinates"),
919
+ anno::soft_range(0.0f, 100.0f)
920
+ ]],
921
+
922
+ uniform bool uvw_s_flip = false [[
923
+ anno::display_name("Flip U"),
924
+ anno::in_group("UVW Coordinates")
925
+ ]],
926
+
927
+ uniform bool uvw_t_flip = false [[
928
+ anno::display_name("Flip V"),
929
+ anno::in_group("UVW Coordinates")
930
+ ]],
931
+
932
+ uniform bool uvw_swap_st = false [[
933
+ anno::display_name("Swap UV"),
934
+ anno::in_group("UVW Coordinates")
935
+ ]],
936
+
937
+ //Projection Coordinates (Local / World)
938
+ uniform ::OmniSurface::OmniImage::projection_mode uvw_projection_mode =
939
+ ::OmniSurface::OmniImage::projection_cubic [[
940
+ anno::display_name("Projection Mode"),
941
+ anno::in_group("UVW Coordinates")
942
+ ]],
943
+
944
+ uniform float3 uvw_projection_translate = float3(0.0) [[
945
+ anno::display_name("Translate"),
946
+ anno::description("Translate the projected texture."),
947
+ anno::in_group("UVW Coordinates")
948
+ ]],
949
+
950
+ uniform float3 uvw_projection_rotate = float3(0.0) [[
951
+ anno::display_name("Rotate"),
952
+ anno::description("Rotate the projected texture."),
953
+ anno::in_group("UVW Coordinates")
954
+ ]],
955
+
956
+ uniform float3 uvw_projection_scale = float3(1.0) [[
957
+ anno::display_name("Scale"),
958
+ anno::description("Scale the projected texture."),
959
+ anno::in_group("UVW Coordinates")
960
+ ]]
961
+ )
962
+ [[
963
+ anno::display_name("OmniSurface"),
964
+ anno::description("A base material for modeling a variety of surfaces."),
965
+ anno::author("NVIDIA Corporation"),
966
+ anno::key_words(string[]("generic", "surface")),
967
+ anno::version(1, 0, 0, ""),
968
+ anno::in_group("Advanced")
969
+ ]] = let {
970
+
971
+ base::texture_coordinate_info texture_coordinate_info =
972
+ ::OmniSurface::OmniImage::compute_texture_coordinate_2(
973
+ uvw_texture_coordinate_system,
974
+ uvw_uv_set,
975
+ uvw_s_offset,
976
+ uvw_t_offset,
977
+ uvw_s_scale,
978
+ uvw_t_scale,
979
+ uvw_s_flip,
980
+ uvw_t_flip,
981
+ uvw_swap_st,
982
+ uvw_projection_mode,
983
+ uvw_projection_translate,
984
+ uvw_projection_rotate,
985
+ uvw_projection_scale);
986
+
987
+ ::OmniSurface::OmniImage::normal_roughness_data geometry_normal_roughness_data =
988
+ tex::texture_isvalid(geometry_normal_image) ?
989
+ ::OmniSurface::OmniImage::tangent_space_normal_roughness_lookup_2(
990
+ geometry_normal_image,
991
+ uvw_ignore_missing_textures,
992
+ uvw_use_uv_coords,
993
+ uvw_uv_coords,
994
+ uvw_s_wrap,
995
+ uvw_t_wrap,
996
+ uvw_s_flip,
997
+ uvw_t_flip,
998
+ geometry_normal_strength,
999
+ geometry_normal_image_flip_r_channel,
1000
+ geometry_normal_image_flip_g_channel,
1001
+ geometry_normal_image_flip_b_channel,
1002
+ texture_coordinate_info
1003
+ ) :
1004
+ ::OmniSurface::OmniImage::normal_roughness_data(geometry_normal, float2(0.0));
1005
+
1006
+ material base = ::OmniSurface::OmniSurfaceBase::OmniSurfaceBase(
1007
+
1008
+ //Base
1009
+ //
1010
+ diffuse_reflection_weight: tex::texture_isvalid(diffuse_reflection_weight_image) ?
1011
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1012
+ ::OmniSurface::OmniImage::texture_lookup_2(
1013
+ diffuse_reflection_weight_image,
1014
+ uvw_ignore_missing_textures,
1015
+ uvw_missing_texture_color,
1016
+ uvw_use_uv_coords,
1017
+ uvw_uv_coords,
1018
+ uvw_s_wrap,
1019
+ uvw_t_wrap,
1020
+ texture_coordinate_info
1021
+ ),
1022
+ diffuse_reflection_weight_image_alpha_mode
1023
+ ).mono :
1024
+ diffuse_reflection_weight,
1025
+
1026
+ diffuse_reflection_color: tex::texture_isvalid(diffuse_reflection_color_image) ?
1027
+ ::OmniSurface::OmniImage::texture_lookup_2(
1028
+ diffuse_reflection_color_image,
1029
+ uvw_ignore_missing_textures,
1030
+ uvw_missing_texture_color,
1031
+ uvw_use_uv_coords,
1032
+ uvw_uv_coords,
1033
+ uvw_s_wrap,
1034
+ uvw_t_wrap,
1035
+ texture_coordinate_info
1036
+ ).tint :
1037
+ diffuse_reflection_color,
1038
+
1039
+ diffuse_reflection_roughness: tex::texture_isvalid(diffuse_reflection_roughness_image) ?
1040
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1041
+ ::OmniSurface::OmniImage::texture_lookup_2(
1042
+ diffuse_reflection_roughness_image,
1043
+ uvw_ignore_missing_textures,
1044
+ uvw_missing_texture_color,
1045
+ uvw_use_uv_coords,
1046
+ uvw_uv_coords,
1047
+ uvw_s_wrap,
1048
+ uvw_t_wrap,
1049
+ texture_coordinate_info
1050
+ ),
1051
+ diffuse_reflection_roughness_image_alpha_mode
1052
+ ).mono :
1053
+ diffuse_reflection_roughness,
1054
+
1055
+ //Metalness
1056
+ //
1057
+ metalness: tex::texture_isvalid(metalness_image) ?
1058
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1059
+ ::OmniSurface::OmniImage::texture_lookup_2(
1060
+ metalness_image,
1061
+ uvw_ignore_missing_textures,
1062
+ uvw_missing_texture_color,
1063
+ uvw_use_uv_coords,
1064
+ uvw_uv_coords,
1065
+ uvw_s_wrap,
1066
+ uvw_t_wrap,
1067
+ texture_coordinate_info
1068
+ ),
1069
+ metalness_image_alpha_mode
1070
+ ).mono :
1071
+ metalness,
1072
+
1073
+ //Specular reflection
1074
+ //
1075
+ specular_reflection_weight: tex::texture_isvalid(specular_reflection_weight_image) ?
1076
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1077
+ ::OmniSurface::OmniImage::texture_lookup_2(
1078
+ specular_reflection_weight_image,
1079
+ uvw_ignore_missing_textures,
1080
+ uvw_missing_texture_color,
1081
+ uvw_use_uv_coords,
1082
+ uvw_uv_coords,
1083
+ uvw_s_wrap,
1084
+ uvw_t_wrap,
1085
+ texture_coordinate_info
1086
+ ),
1087
+ specular_reflection_weight_image_alpha_mode
1088
+ ).mono :
1089
+ specular_reflection_weight,
1090
+
1091
+ specular_reflection_color: tex::texture_isvalid(specular_reflection_color_image) ?
1092
+ ::OmniSurface::OmniImage::texture_lookup_2(
1093
+ specular_reflection_color_image,
1094
+ uvw_ignore_missing_textures,
1095
+ uvw_missing_texture_color,
1096
+ uvw_use_uv_coords,
1097
+ uvw_uv_coords,
1098
+ uvw_s_wrap,
1099
+ uvw_t_wrap,
1100
+ texture_coordinate_info
1101
+ ).tint :
1102
+ specular_reflection_color,
1103
+
1104
+ specular_reflection_roughness: tex::texture_isvalid(specular_reflection_roughness_image) ?
1105
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1106
+ ::OmniSurface::OmniImage::texture_lookup_2(
1107
+ specular_reflection_roughness_image,
1108
+ uvw_ignore_missing_textures,
1109
+ uvw_missing_texture_color,
1110
+ uvw_use_uv_coords,
1111
+ uvw_uv_coords,
1112
+ uvw_s_wrap,
1113
+ uvw_t_wrap,
1114
+ texture_coordinate_info
1115
+ ),
1116
+ specular_reflection_roughness_image_alpha_mode
1117
+ ).mono :
1118
+ specular_reflection_roughness,
1119
+
1120
+ specular_reflection_ior_preset: specular_reflection_ior_preset,
1121
+ specular_reflection_ior: specular_reflection_ior,
1122
+
1123
+ specular_reflection_anisotropy: tex::texture_isvalid(specular_reflection_anisotropy_image) ?
1124
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1125
+ ::OmniSurface::OmniImage::texture_lookup_2(
1126
+ specular_reflection_anisotropy_image,
1127
+ uvw_ignore_missing_textures,
1128
+ uvw_missing_texture_color,
1129
+ uvw_use_uv_coords,
1130
+ uvw_uv_coords,
1131
+ uvw_s_wrap,
1132
+ uvw_t_wrap,
1133
+ texture_coordinate_info
1134
+ ),
1135
+ specular_reflection_anisotropy_image_alpha_mode
1136
+ ).mono :
1137
+ specular_reflection_anisotropy,
1138
+
1139
+ specular_reflection_anisotropy_rotation: tex::texture_isvalid(specular_reflection_anisotropy_rotation_image) ?
1140
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1141
+ ::OmniSurface::OmniImage::texture_lookup_2(
1142
+ specular_reflection_anisotropy_rotation_image,
1143
+ uvw_ignore_missing_textures,
1144
+ uvw_missing_texture_color,
1145
+ uvw_use_uv_coords,
1146
+ uvw_uv_coords,
1147
+ uvw_s_wrap,
1148
+ uvw_t_wrap,
1149
+ texture_coordinate_info
1150
+ ),
1151
+ specular_reflection_anisotropy_rotation_image_alpha_mode
1152
+ ).mono :
1153
+ specular_reflection_anisotropy_rotation,
1154
+
1155
+ //Specular transmission
1156
+ //
1157
+ enable_specular_transmission: enable_specular_transmission,
1158
+
1159
+ specular_transmission_weight: tex::texture_isvalid(specular_transmission_weight_image) ?
1160
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1161
+ ::OmniSurface::OmniImage::texture_lookup_2(
1162
+ specular_transmission_weight_image,
1163
+ uvw_ignore_missing_textures,
1164
+ uvw_missing_texture_color,
1165
+ uvw_use_uv_coords,
1166
+ uvw_uv_coords,
1167
+ uvw_s_wrap,
1168
+ uvw_t_wrap,
1169
+ texture_coordinate_info
1170
+ ),
1171
+ specular_transmission_weight_image_alpha_mode
1172
+ ).mono :
1173
+ specular_transmission_weight,
1174
+
1175
+ specular_transmission_color: tex::texture_isvalid(specular_transmission_color_image) ?
1176
+ ::OmniSurface::OmniImage::texture_lookup_2(
1177
+ specular_transmission_color_image,
1178
+ uvw_ignore_missing_textures,
1179
+ uvw_missing_texture_color,
1180
+ uvw_use_uv_coords,
1181
+ uvw_uv_coords,
1182
+ uvw_s_wrap,
1183
+ uvw_t_wrap,
1184
+ texture_coordinate_info
1185
+ ).tint :
1186
+ specular_transmission_color,
1187
+
1188
+ specular_transmission_scattering_depth: tex::texture_isvalid(specular_transmission_scattering_depth_image) ?
1189
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1190
+ ::OmniSurface::OmniImage::texture_lookup_2(
1191
+ specular_transmission_scattering_depth_image,
1192
+ uvw_ignore_missing_textures,
1193
+ uvw_missing_texture_color,
1194
+ uvw_use_uv_coords,
1195
+ uvw_uv_coords,
1196
+ uvw_s_wrap,
1197
+ uvw_t_wrap,
1198
+ texture_coordinate_info
1199
+ ),
1200
+ specular_transmission_scattering_depth_image_alpha_mode
1201
+ ).mono :
1202
+ specular_transmission_scattering_depth,
1203
+
1204
+ specular_transmission_scattering_color: tex::texture_isvalid(specular_transmission_scattering_color_image) ?
1205
+ ::OmniSurface::OmniImage::texture_lookup_2(
1206
+ specular_transmission_scattering_color_image,
1207
+ uvw_ignore_missing_textures,
1208
+ uvw_missing_texture_color,
1209
+ uvw_use_uv_coords,
1210
+ uvw_uv_coords,
1211
+ uvw_s_wrap,
1212
+ uvw_t_wrap,
1213
+ texture_coordinate_info
1214
+ ).tint :
1215
+ specular_transmission_scattering_color,
1216
+
1217
+ specular_transmission_scatter_anisotropy: tex::texture_isvalid(specular_transmission_scatter_anisotropy_image) ?
1218
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1219
+ ::OmniSurface::OmniImage::texture_lookup_2(
1220
+ specular_transmission_scatter_anisotropy_image,
1221
+ uvw_ignore_missing_textures,
1222
+ uvw_missing_texture_color,
1223
+ uvw_use_uv_coords,
1224
+ uvw_uv_coords,
1225
+ uvw_s_wrap,
1226
+ uvw_t_wrap,
1227
+ texture_coordinate_info
1228
+ ),
1229
+ specular_transmission_scatter_anisotropy_image_alpha_mode
1230
+ ).mono :
1231
+ specular_transmission_scatter_anisotropy,
1232
+
1233
+ specular_transmission_dispersion_abbe: specular_transmission_dispersion_abbe,
1234
+
1235
+ //Subsurface
1236
+ //
1237
+ enable_diffuse_transmission: enable_diffuse_transmission,
1238
+
1239
+ subsurface_weight: tex::texture_isvalid(subsurface_weight_image) ?
1240
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1241
+ ::OmniSurface::OmniImage::texture_lookup_2(
1242
+ subsurface_weight_image,
1243
+ uvw_ignore_missing_textures,
1244
+ uvw_missing_texture_color,
1245
+ uvw_use_uv_coords,
1246
+ uvw_uv_coords,
1247
+ uvw_s_wrap,
1248
+ uvw_t_wrap,
1249
+ texture_coordinate_info
1250
+ ),
1251
+ subsurface_weight_image_alpha_mode
1252
+ ).mono :
1253
+ subsurface_weight,
1254
+
1255
+ subsurface_scattering_colors_preset: subsurface_scattering_colors_preset,
1256
+
1257
+ subsurface_transmission_color: tex::texture_isvalid(subsurface_transmission_color_image) ?
1258
+ ::OmniSurface::OmniImage::texture_lookup_2(
1259
+ subsurface_transmission_color_image,
1260
+ uvw_ignore_missing_textures,
1261
+ uvw_missing_texture_color,
1262
+ uvw_use_uv_coords,
1263
+ uvw_uv_coords,
1264
+ uvw_s_wrap,
1265
+ uvw_t_wrap,
1266
+ texture_coordinate_info
1267
+ ).tint :
1268
+ subsurface_transmission_color,
1269
+
1270
+ subsurface_scattering_color: tex::texture_isvalid(subsurface_scattering_color_image) ?
1271
+ ::OmniSurface::OmniImage::texture_lookup_2(
1272
+ subsurface_scattering_color_image,
1273
+ uvw_ignore_missing_textures,
1274
+ uvw_missing_texture_color,
1275
+ uvw_use_uv_coords,
1276
+ uvw_uv_coords,
1277
+ uvw_s_wrap,
1278
+ uvw_t_wrap,
1279
+ texture_coordinate_info
1280
+ ).tint :
1281
+ subsurface_scattering_color,
1282
+
1283
+ subsurface_scale: tex::texture_isvalid(subsurface_scale_image) ?
1284
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1285
+ ::OmniSurface::OmniImage::texture_lookup_2(
1286
+ subsurface_scale_image,
1287
+ uvw_ignore_missing_textures,
1288
+ uvw_missing_texture_color,
1289
+ uvw_use_uv_coords,
1290
+ uvw_uv_coords,
1291
+ uvw_s_wrap,
1292
+ uvw_t_wrap,
1293
+ texture_coordinate_info
1294
+ ),
1295
+ subsurface_scale_image_alpha_mode
1296
+ ).mono :
1297
+ subsurface_scale,
1298
+
1299
+ subsurface_anisotropy: tex::texture_isvalid(subsurface_anisotropy_image) ?
1300
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1301
+ ::OmniSurface::OmniImage::texture_lookup_2(
1302
+ subsurface_anisotropy_image,
1303
+ uvw_ignore_missing_textures,
1304
+ uvw_missing_texture_color,
1305
+ uvw_use_uv_coords,
1306
+ uvw_uv_coords,
1307
+ uvw_s_wrap,
1308
+ uvw_t_wrap,
1309
+ texture_coordinate_info
1310
+ ),
1311
+ subsurface_anisotropy_image_alpha_mode
1312
+ ).mono :
1313
+ subsurface_anisotropy,
1314
+
1315
+ //Coat
1316
+ //
1317
+ coat_weight: tex::texture_isvalid(coat_weight_image) ?
1318
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1319
+ ::OmniSurface::OmniImage::texture_lookup_2(
1320
+ coat_weight_image,
1321
+ uvw_ignore_missing_textures,
1322
+ uvw_missing_texture_color,
1323
+ uvw_use_uv_coords,
1324
+ uvw_uv_coords,
1325
+ uvw_s_wrap,
1326
+ uvw_t_wrap,
1327
+ texture_coordinate_info
1328
+ ),
1329
+ coat_weight_image_alpha_mode
1330
+ ).mono :
1331
+ coat_weight,
1332
+
1333
+ coat_color: tex::texture_isvalid(coat_color_image) ?
1334
+ ::OmniSurface::OmniImage::texture_lookup_2(
1335
+ coat_color_image,
1336
+ uvw_ignore_missing_textures,
1337
+ uvw_missing_texture_color,
1338
+ uvw_use_uv_coords,
1339
+ uvw_uv_coords,
1340
+ uvw_s_wrap,
1341
+ uvw_t_wrap,
1342
+ texture_coordinate_info
1343
+ ).tint :
1344
+ coat_color,
1345
+
1346
+ coat_roughness: tex::texture_isvalid(coat_roughness_image) ?
1347
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1348
+ ::OmniSurface::OmniImage::texture_lookup_2(
1349
+ coat_roughness_image,
1350
+ uvw_ignore_missing_textures,
1351
+ uvw_missing_texture_color,
1352
+ uvw_use_uv_coords,
1353
+ uvw_uv_coords,
1354
+ uvw_s_wrap,
1355
+ uvw_t_wrap,
1356
+ texture_coordinate_info
1357
+ ),
1358
+ coat_roughness_image_alpha_mode
1359
+ ).mono :
1360
+ coat_roughness,
1361
+
1362
+ coat_ior_preset: coat_ior_preset,
1363
+ coat_ior: coat_ior,
1364
+
1365
+ coat_anisotropy: tex::texture_isvalid(coat_anisotropy_image) ?
1366
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1367
+ ::OmniSurface::OmniImage::texture_lookup_2(
1368
+ coat_anisotropy_image,
1369
+ uvw_ignore_missing_textures,
1370
+ uvw_missing_texture_color,
1371
+ uvw_use_uv_coords,
1372
+ uvw_uv_coords,
1373
+ uvw_s_wrap,
1374
+ uvw_t_wrap,
1375
+ texture_coordinate_info
1376
+ ),
1377
+ coat_anisotropy_image_alpha_mode
1378
+ ).mono :
1379
+ coat_anisotropy,
1380
+
1381
+ coat_anisotropy_rotation: tex::texture_isvalid(coat_anisotropy_rotation_image) ?
1382
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1383
+ ::OmniSurface::OmniImage::texture_lookup_2(
1384
+ coat_anisotropy_rotation_image,
1385
+ uvw_ignore_missing_textures,
1386
+ uvw_missing_texture_color,
1387
+ uvw_use_uv_coords,
1388
+ uvw_uv_coords,
1389
+ uvw_s_wrap,
1390
+ uvw_t_wrap,
1391
+ texture_coordinate_info
1392
+ ),
1393
+ coat_anisotropy_rotation_image_alpha_mode
1394
+ ).mono :
1395
+ coat_anisotropy_rotation,
1396
+
1397
+ coat_affect_color: tex::texture_isvalid(coat_affect_color_image) ?
1398
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1399
+ ::OmniSurface::OmniImage::texture_lookup_2(
1400
+ coat_affect_color_image,
1401
+ uvw_ignore_missing_textures,
1402
+ uvw_missing_texture_color,
1403
+ uvw_use_uv_coords,
1404
+ uvw_uv_coords,
1405
+ uvw_s_wrap,
1406
+ uvw_t_wrap,
1407
+ texture_coordinate_info
1408
+ ),
1409
+ coat_affect_color_image_alpha_mode
1410
+ ).mono :
1411
+ coat_affect_color,
1412
+
1413
+ coat_affect_roughness: tex::texture_isvalid(coat_affect_roughness_image) ?
1414
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1415
+ ::OmniSurface::OmniImage::texture_lookup_2(
1416
+ coat_affect_roughness_image,
1417
+ uvw_ignore_missing_textures,
1418
+ uvw_missing_texture_color,
1419
+ uvw_use_uv_coords,
1420
+ uvw_uv_coords,
1421
+ uvw_s_wrap,
1422
+ uvw_t_wrap,
1423
+ texture_coordinate_info
1424
+ ),
1425
+ coat_affect_roughness_image_alpha_mode
1426
+ ).mono :
1427
+ coat_affect_roughness,
1428
+
1429
+ coat_normal: tex::texture_isvalid(coat_normal_image) ?
1430
+ ::OmniSurface::OmniImage::normal_mapping(
1431
+ ::OmniSurface::OmniImage::tangent_space_normal_lookup_2(
1432
+ coat_normal_image,
1433
+ uvw_ignore_missing_textures,
1434
+ uvw_use_uv_coords,
1435
+ uvw_uv_coords,
1436
+ uvw_s_wrap,
1437
+ uvw_t_wrap,
1438
+ uvw_s_flip,
1439
+ uvw_t_flip,
1440
+ coat_normal_strength,
1441
+ coat_normal_image_flip_r_channel,
1442
+ coat_normal_image_flip_g_channel,
1443
+ coat_normal_image_flip_b_channel,
1444
+ texture_coordinate_info
1445
+ ),
1446
+ geometry_tangent_bitangent_mapping,
1447
+ coat_normal
1448
+ ):
1449
+ coat_normal,
1450
+
1451
+ //Specular retro reflection
1452
+ //
1453
+ specular_retro_reflection_weight: tex::texture_isvalid(specular_retro_reflection_weight_image) ?
1454
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1455
+ ::OmniSurface::OmniImage::texture_lookup_2(
1456
+ specular_retro_reflection_weight_image,
1457
+ uvw_ignore_missing_textures,
1458
+ uvw_missing_texture_color,
1459
+ uvw_use_uv_coords,
1460
+ uvw_uv_coords,
1461
+ uvw_s_wrap,
1462
+ uvw_t_wrap,
1463
+ texture_coordinate_info
1464
+ ),
1465
+ specular_retro_reflection_weight_image_alpha_mode
1466
+ ).mono :
1467
+ specular_retro_reflection_weight,
1468
+
1469
+ specular_retro_reflection_color: tex::texture_isvalid(specular_retro_reflection_color_image) ?
1470
+ ::OmniSurface::OmniImage::texture_lookup_2(
1471
+ specular_retro_reflection_color_image,
1472
+ uvw_ignore_missing_textures,
1473
+ uvw_missing_texture_color,
1474
+ uvw_use_uv_coords,
1475
+ uvw_uv_coords,
1476
+ uvw_s_wrap,
1477
+ uvw_t_wrap,
1478
+ texture_coordinate_info
1479
+ ).tint :
1480
+ specular_retro_reflection_color,
1481
+
1482
+ specular_retro_reflection_roughness: tex::texture_isvalid(specular_retro_reflection_roughness_image) ?
1483
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1484
+ ::OmniSurface::OmniImage::texture_lookup_2(
1485
+ specular_retro_reflection_roughness_image,
1486
+ uvw_ignore_missing_textures,
1487
+ uvw_missing_texture_color,
1488
+ uvw_use_uv_coords,
1489
+ uvw_uv_coords,
1490
+ uvw_s_wrap,
1491
+ uvw_t_wrap,
1492
+ texture_coordinate_info
1493
+ ),
1494
+ specular_retro_reflection_roughness_image_alpha_mode
1495
+ ).mono :
1496
+ specular_retro_reflection_roughness,
1497
+
1498
+ //Emission
1499
+ //
1500
+ emission_weight: tex::texture_isvalid(emission_weight_image) ?
1501
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1502
+ ::OmniSurface::OmniImage::texture_lookup_2(
1503
+ emission_weight_image,
1504
+ uvw_ignore_missing_textures,
1505
+ uvw_missing_texture_color,
1506
+ uvw_use_uv_coords,
1507
+ uvw_uv_coords,
1508
+ uvw_s_wrap,
1509
+ uvw_t_wrap,
1510
+ texture_coordinate_info
1511
+ ),
1512
+ emission_weight_image_alpha_mode
1513
+ ).mono :
1514
+ emission_weight,
1515
+
1516
+ emission_mode: emission_mode,
1517
+
1518
+ emission_intensity: tex::texture_isvalid(emission_intensity_image) ?
1519
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1520
+ ::OmniSurface::OmniImage::texture_lookup_2(
1521
+ emission_intensity_image,
1522
+ uvw_ignore_missing_textures,
1523
+ uvw_missing_texture_color,
1524
+ uvw_use_uv_coords,
1525
+ uvw_uv_coords,
1526
+ uvw_s_wrap,
1527
+ uvw_t_wrap,
1528
+ texture_coordinate_info
1529
+ ),
1530
+ emission_intensity_image_alpha_mode
1531
+ ).mono :
1532
+ emission_intensity,
1533
+
1534
+ emission_color: tex::texture_isvalid(emission_color_image) ?
1535
+ ::OmniSurface::OmniImage::texture_lookup_2(
1536
+ emission_color_image,
1537
+ uvw_ignore_missing_textures,
1538
+ uvw_missing_texture_color,
1539
+ uvw_use_uv_coords,
1540
+ uvw_uv_coords,
1541
+ uvw_s_wrap,
1542
+ uvw_t_wrap,
1543
+ texture_coordinate_info
1544
+ ).tint :
1545
+ emission_color,
1546
+
1547
+ emission_use_temperature: emission_use_temperature,
1548
+
1549
+ emission_temperature: tex::texture_isvalid(emission_temperature_image) ?
1550
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1551
+ ::OmniSurface::OmniImage::texture_lookup_2(
1552
+ emission_temperature_image,
1553
+ uvw_ignore_missing_textures,
1554
+ uvw_missing_texture_color,
1555
+ uvw_use_uv_coords,
1556
+ uvw_uv_coords,
1557
+ uvw_s_wrap,
1558
+ uvw_t_wrap,
1559
+ texture_coordinate_info
1560
+ ),
1561
+ emission_temperature_image_alpha_mode
1562
+ ).mono :
1563
+ emission_temperature,
1564
+
1565
+ //Thin Film
1566
+ //
1567
+ enable_thin_film: enable_thin_film,
1568
+
1569
+ thin_film_thickness: tex::texture_isvalid(thin_film_thickness_image) ?
1570
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1571
+ ::OmniSurface::OmniImage::texture_lookup_2(
1572
+ thin_film_thickness_image,
1573
+ uvw_ignore_missing_textures,
1574
+ uvw_missing_texture_color,
1575
+ uvw_use_uv_coords,
1576
+ uvw_uv_coords,
1577
+ uvw_s_wrap,
1578
+ uvw_t_wrap,
1579
+ texture_coordinate_info
1580
+ ),
1581
+ thin_film_thickness_image_alpha_mode
1582
+ ).mono :
1583
+ thin_film_thickness,
1584
+
1585
+ thin_film_ior_preset: thin_film_ior_preset,
1586
+ thin_film_ior: thin_film_ior,
1587
+
1588
+ //Geometry
1589
+ //
1590
+ thin_walled: thin_walled,
1591
+
1592
+ enable_opacity: enable_opacity,
1593
+
1594
+ geometry_opacity: tex::texture_isvalid(geometry_opacity_image) ?
1595
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1596
+ ::OmniSurface::OmniImage::texture_lookup_2(
1597
+ geometry_opacity_image,
1598
+ uvw_ignore_missing_textures,
1599
+ uvw_missing_texture_color,
1600
+ uvw_use_uv_coords,
1601
+ uvw_uv_coords,
1602
+ uvw_s_wrap,
1603
+ uvw_t_wrap,
1604
+ texture_coordinate_info
1605
+ ),
1606
+ geometry_opacity_image_alpha_mode
1607
+ ).mono :
1608
+ geometry_opacity,
1609
+
1610
+ geometry_opacity_threshold: geometry_opacity_threshold,
1611
+
1612
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
1613
+
1614
+ geometry_normal_roughness: geometry_normal_roughness_data.roughness,
1615
+
1616
+ geometry_normal: ::OmniSurface::OmniImage::normal_mapping(
1617
+ geometry_normal_roughness_data.normal,
1618
+ geometry_tangent_bitangent_mapping,
1619
+ geometry_normal),
1620
+
1621
+ geometry_displacement: tex::texture_isvalid(geometry_displacement_image) ?
1622
+ ::OmniSurface::OmniShared::displacement_adjustment(
1623
+ (geometry_displacement_mode == ::OmniSurface::OmniShared::displacement_height) ?
1624
+ float3(::OmniSurface::OmniImage::texture_adjustment_2(
1625
+ OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1626
+ ::OmniSurface::OmniImage::texture_lookup_2(
1627
+ geometry_displacement_image,
1628
+ uvw_ignore_missing_textures,
1629
+ uvw_missing_texture_color,
1630
+ uvw_use_uv_coords,
1631
+ uvw_uv_coords,
1632
+ uvw_s_wrap,
1633
+ uvw_t_wrap,
1634
+ texture_coordinate_info
1635
+ ),
1636
+ geometry_displacement_image_alpha_mode
1637
+ ),
1638
+ 0.0f, //exposure
1639
+ color(0.5), //default_color
1640
+ color(1.0), //color_gain
1641
+ color(0.0), //color_offset
1642
+ 1.0f, //alpha_gain
1643
+ -1.0f * geometry_displacement_scalar_zero_value, //alpha_offset
1644
+ false, //invert
1645
+ 0.0f //blend_factor
1646
+ ).mono) :
1647
+
1648
+ float3(::OmniSurface::OmniImage::texture_lookup_2(
1649
+ geometry_displacement_image,
1650
+ uvw_ignore_missing_textures,
1651
+ uvw_missing_texture_color,
1652
+ uvw_use_uv_coords,
1653
+ uvw_uv_coords,
1654
+ uvw_s_wrap,
1655
+ uvw_t_wrap,
1656
+ texture_coordinate_info
1657
+ ).tint
1658
+ ),
1659
+
1660
+ geometry_displacement_mode,
1661
+
1662
+ tex::texture_isvalid(geometry_displacement_scale_image) ?
1663
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1664
+ ::OmniSurface::OmniImage::texture_lookup_2(
1665
+ geometry_displacement_scale_image,
1666
+ uvw_ignore_missing_textures,
1667
+ uvw_missing_texture_color,
1668
+ uvw_use_uv_coords,
1669
+ uvw_uv_coords,
1670
+ uvw_s_wrap,
1671
+ uvw_t_wrap,
1672
+ texture_coordinate_info
1673
+ ),
1674
+ geometry_displacement_scale_image_alpha_mode
1675
+ ).mono :
1676
+ geometry_displacement_scale
1677
+ ):
1678
+ geometry_displacement
1679
+ );
1680
+
1681
+ } in material(
1682
+ thin_walled: base.thin_walled,
1683
+ ior: base.ior,
1684
+ surface: base.surface,
1685
+ backface: base.backface,
1686
+ volume: base.volume,
1687
+ geometry: base.geometry
1688
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurfaceLite.mdl ADDED
@@ -0,0 +1,1187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***************************************************************************************************
2
+ * Copyright 2020 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ **************************************************************************************************/
28
+
29
+ // Wrapper for OmniSurfaceLiteBase material
30
+
31
+ mdl 1.7;
32
+
33
+ import ::anno::*;
34
+ import ::base::*;
35
+ import ::limits::*;
36
+ import ::state::*;
37
+ import ::tex::*;
38
+
39
+ import ::OmniSurface::OmniSurfaceLiteBase::*;
40
+ import ::OmniSurface::OmniShared::*;
41
+ import ::OmniSurface::OmniImage::*;
42
+
43
+ export material OmniSurfaceLite(
44
+
45
+ //Diffuse reflection
46
+ //
47
+ float diffuse_reflection_weight = float(0.8) [[
48
+ anno::display_name("Weight"),
49
+ anno::in_group("Base"),
50
+ anno::hard_range(0.0f, 1.0f)
51
+ ]],
52
+
53
+ uniform texture_2d diffuse_reflection_weight_image = texture_2d() [[
54
+ anno::display_name("Weight Image"),
55
+ anno::in_group("Base"),
56
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
57
+ ]],
58
+
59
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_weight_image_alpha_mode =
60
+ ::OmniSurface::OmniImage::alpha_default [[
61
+ anno::display_name("Weight Image Alpha Mode"),
62
+ anno::in_group("Base")
63
+ ]],
64
+
65
+ color diffuse_reflection_color = color(1.0) [[
66
+ anno::display_name("Color"),
67
+ anno::in_group("Base")
68
+ ]],
69
+
70
+ uniform texture_2d diffuse_reflection_color_image = texture_2d() [[
71
+ anno::display_name("Color Image"),
72
+ anno::in_group("Base")
73
+ ]],
74
+
75
+ float diffuse_reflection_roughness = float(0.0) [[
76
+ anno::display_name("Diffuse Roughness"),
77
+ anno::in_group("Base"),
78
+ anno::hard_range(0.0f, 1.0f)
79
+ ]],
80
+
81
+ uniform texture_2d diffuse_reflection_roughness_image = texture_2d() [[
82
+ anno::display_name("Diffuse Roughness Image"),
83
+ anno::in_group("Base"),
84
+ anno::usage("roughness")
85
+ ]],
86
+
87
+ uniform ::OmniSurface::OmniImage::alpha_mode diffuse_reflection_roughness_image_alpha_mode =
88
+ ::OmniSurface::OmniImage::alpha_default [[
89
+ anno::display_name("Diffuse Roughness Alpha Mode"),
90
+ anno::in_group("Base")
91
+ ]],
92
+
93
+ //Metal
94
+ //
95
+ float metalness = float(0.0) [[
96
+ anno::display_name("Metalness"),
97
+ anno::in_group("Base"),
98
+ anno::hard_range(0.0f, 1.0f)
99
+ ]],
100
+
101
+ uniform texture_2d metalness_image = texture_2d() [[
102
+ anno::display_name("Metalness Image"),
103
+ anno::in_group("Base"),
104
+ anno::usage("metalness")
105
+ ]],
106
+
107
+ uniform ::OmniSurface::OmniImage::alpha_mode metalness_image_alpha_mode =
108
+ ::OmniSurface::OmniImage::alpha_default [[
109
+ anno::display_name("Metalness Image Alpha Mode"),
110
+ anno::in_group("Base")
111
+ ]],
112
+
113
+ //Specular reflection
114
+ //
115
+ float specular_reflection_weight = float(1.0) [[
116
+ anno::display_name("Weight"),
117
+ anno::in_group("Specular"),
118
+ anno::hard_range(0.0f, 1.0f)
119
+ ]],
120
+
121
+ uniform texture_2d specular_reflection_weight_image = texture_2d() [[
122
+ anno::display_name("Weight Image"),
123
+ anno::in_group("Specular"),
124
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
125
+ ]],
126
+
127
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_weight_image_alpha_mode =
128
+ ::OmniSurface::OmniImage::alpha_default [[
129
+ anno::display_name("Weight Image Alpha Mode"),
130
+ anno::in_group("Specular")
131
+ ]],
132
+
133
+ color specular_reflection_color = color(1.0) [[
134
+ anno::display_name("Color"),
135
+ anno::in_group("Specular")
136
+ ]],
137
+
138
+ uniform texture_2d specular_reflection_color_image = texture_2d() [[
139
+ anno::display_name("Color Image"),
140
+ anno::in_group("Specular")
141
+ ]],
142
+
143
+ float specular_reflection_roughness = float(0.2) [[
144
+ anno::display_name("Roughness"),
145
+ anno::in_group("Specular"),
146
+ anno::hard_range(0.0f, 1.0f)
147
+ ]],
148
+
149
+ uniform texture_2d specular_reflection_roughness_image = texture_2d() [[
150
+ anno::display_name("Roughness Image"),
151
+ anno::in_group("Specular"),
152
+ anno::usage("roughness")
153
+ ]],
154
+
155
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_roughness_image_alpha_mode =
156
+ ::OmniSurface::OmniImage::alpha_default [[
157
+ anno::display_name("Roughness Image Alpha Mode"),
158
+ anno::in_group("Specular")
159
+ ]],
160
+
161
+ uniform ::OmniSurface::OmniShared::ior_presets specular_reflection_ior_preset =
162
+ ::OmniSurface::OmniShared::ior_custom [[
163
+ anno::display_name("IOR Preset"),
164
+ anno::in_group("Specular")
165
+ ]],
166
+
167
+ uniform float specular_reflection_ior = float(1.5) [[
168
+ anno::display_name("IOR"),
169
+ anno::in_group("Specular"),
170
+ anno::soft_range(1.0f, 5.0f),
171
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
172
+ ]],
173
+
174
+ float specular_reflection_anisotropy = float(0.0) [[
175
+ anno::display_name("Anisotropy"),
176
+ anno::in_group("Specular"),
177
+ anno::hard_range(0.0f, 1.0f)
178
+ ]],
179
+
180
+ uniform texture_2d specular_reflection_anisotropy_image = texture_2d() [[
181
+ anno::display_name("Anisotropy Image"),
182
+ anno::in_group("Specular"),
183
+ anno::usage("aniotropy")
184
+ ]],
185
+
186
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_image_alpha_mode =
187
+ ::OmniSurface::OmniImage::alpha_default [[
188
+ anno::display_name("Anisotropy Image Alpha Mode"),
189
+ anno::in_group("Specular")
190
+ ]],
191
+
192
+ float specular_reflection_anisotropy_rotation = float(0.0) [[
193
+ anno::display_name("Rotation (radian)"),
194
+ anno::in_group("Specular"),
195
+ anno::soft_range(0.0f, 1.0f)
196
+ ]],
197
+
198
+ uniform texture_2d specular_reflection_anisotropy_rotation_image = texture_2d() [[
199
+ anno::display_name("Anisotropy Rotation Image"),
200
+ anno::in_group("Specular"),
201
+ anno::usage("anisotropy_rotation")
202
+ ]],
203
+
204
+ uniform ::OmniSurface::OmniImage::alpha_mode specular_reflection_anisotropy_rotation_image_alpha_mode =
205
+ ::OmniSurface::OmniImage::alpha_default [[
206
+ anno::display_name("Anisotropy Rotation Alpha Mode"),
207
+ anno::in_group("Specular")
208
+ ]],
209
+
210
+ //Coat
211
+ //
212
+ float coat_weight = float(0.0) [[
213
+ anno::display_name("Weight"),
214
+ anno::in_group("Coat"),
215
+ anno::hard_range(0.0f, 1.0f)
216
+ ]],
217
+
218
+ uniform texture_2d coat_weight_image = texture_2d() [[
219
+ anno::display_name("Weight Image"),
220
+ anno::in_group("Coat"),
221
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
222
+ ]],
223
+
224
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_weight_image_alpha_mode =
225
+ ::OmniSurface::OmniImage::alpha_default [[
226
+ anno::display_name("Weight Image Alpha Mode"),
227
+ anno::in_group("Coat")
228
+ ]],
229
+
230
+ color coat_color = color(1.0) [[
231
+ anno::display_name("Color"),
232
+ anno::in_group("Coat")
233
+ ]],
234
+
235
+ uniform texture_2d coat_color_image = texture_2d() [[
236
+ anno::display_name("Color Image"),
237
+ anno::in_group("Coat")
238
+ ]],
239
+
240
+ float coat_roughness = float(0.1) [[
241
+ anno::display_name("Roughness"),
242
+ anno::in_group("Coat"),
243
+ anno::hard_range(0.0f, 1.0f)
244
+ ]],
245
+
246
+ uniform texture_2d coat_roughness_image = texture_2d() [[
247
+ anno::display_name("Roughness Image"),
248
+ anno::in_group("Coat"),
249
+ anno::usage("roughness")
250
+ ]],
251
+
252
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_roughness_image_alpha_mode =
253
+ ::OmniSurface::OmniImage::alpha_default [[
254
+ anno::display_name("Roughness Image Alpha Mode"),
255
+ anno::in_group("Coat")
256
+ ]],
257
+
258
+ uniform ::OmniSurface::OmniShared::ior_presets coat_ior_preset =
259
+ ::OmniSurface::OmniShared::ior_custom [[
260
+ anno::display_name("IOR Preset"),
261
+ anno::in_group("Coat")
262
+ ]],
263
+
264
+ uniform float coat_ior = float(1.5) [[
265
+ anno::display_name("IOR"),
266
+ anno::in_group("Coat"),
267
+ anno::soft_range(1.0f, 5.0f),
268
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
269
+ ]],
270
+
271
+ float coat_anisotropy = float(0.0) [[
272
+ anno::display_name("Anisotropy"),
273
+ anno::in_group("Coat"),
274
+ anno::hard_range(0.0f, 1.0f)
275
+ ]],
276
+
277
+ uniform texture_2d coat_anisotropy_image = texture_2d() [[
278
+ anno::display_name("Anisotropy Image"),
279
+ anno::in_group("Coat"),
280
+ anno::usage("anisotropy")
281
+ ]],
282
+
283
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_image_alpha_mode =
284
+ ::OmniSurface::OmniImage::alpha_default [[
285
+ anno::display_name("Anisotropy Image Alpha Mode"),
286
+ anno::in_group("Coat")
287
+ ]],
288
+
289
+ float coat_anisotropy_rotation = float(0.0) [[
290
+ anno::display_name("Rotation (radian)"),
291
+ anno::in_group("Coat"),
292
+ anno::soft_range(0.0f, 1.0f)
293
+ ]],
294
+
295
+ uniform texture_2d coat_anisotropy_rotation_image = texture_2d() [[
296
+ anno::display_name("Anisotropy Rotation Image"),
297
+ anno::in_group("Coat"),
298
+ anno::usage("anistropy_rotation")
299
+ ]],
300
+
301
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_anisotropy_rotation_image_alpha_mode =
302
+ ::OmniSurface::OmniImage::alpha_default [[
303
+ anno::display_name("Anisotropy Rotation Image Alpha Mode"),
304
+ anno::in_group("Coat")
305
+ ]],
306
+
307
+ float coat_affect_color = float(0.0) [[
308
+ anno::display_name("Affect Color"),
309
+ anno::in_group("Coat"),
310
+ anno::hard_range(0.0f, 1.0f)
311
+ ]],
312
+
313
+ uniform texture_2d coat_affect_color_image = texture_2d() [[
314
+ anno::display_name("Affect Color Image"),
315
+ anno::in_group("Coat"),
316
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
317
+ ]],
318
+
319
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_color_image_alpha_mode =
320
+ ::OmniSurface::OmniImage::alpha_default [[
321
+ anno::display_name("Affect Color Image Alpha Mode"),
322
+ anno::in_group("Coat")
323
+ ]],
324
+
325
+ float coat_affect_roughness = float(0.0) [[
326
+ anno::display_name("Affect Roughness"),
327
+ anno::in_group("Coat"),
328
+ anno::hard_range(0.0f, 1.0f)
329
+ ]],
330
+
331
+ uniform texture_2d coat_affect_roughness_image = texture_2d() [[
332
+ anno::display_name("Affect Roughness Image"),
333
+ anno::in_group("Coat"),
334
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
335
+ ]],
336
+
337
+ uniform ::OmniSurface::OmniImage::alpha_mode coat_affect_roughness_image_alpha_mode =
338
+ ::OmniSurface::OmniImage::alpha_default [[
339
+ anno::display_name("Affect Roughness Alpha Mode"),
340
+ anno::in_group("Coat")
341
+ ]],
342
+
343
+ uniform float coat_normal_strength = float(1.0) [[
344
+ anno::display_name("Normal Strength"),
345
+ anno::in_group("Coat"),
346
+ anno::soft_range(0.0f, 1.0f),
347
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
348
+ ]],
349
+
350
+ float3 coat_normal = state::normal() [[
351
+ anno::display_name("Normal"),
352
+ anno::in_group("Coat"),
353
+ anno::usage("normal")
354
+ ]],
355
+
356
+ uniform texture_2d coat_normal_image = texture_2d() [[
357
+ anno::display_name("Normal Map Image"),
358
+ anno::in_group("Coat"),
359
+ anno::usage("normal")
360
+ ]],
361
+
362
+ uniform bool coat_normal_image_flip_r_channel = false [[
363
+ anno::display_name("Normal Map Flip R Channel"),
364
+ anno::in_group("Coat")
365
+ ]],
366
+
367
+ uniform bool coat_normal_image_flip_g_channel = false [[
368
+ anno::display_name("Normal Map Flip G Channel"),
369
+ anno::in_group("Coat")
370
+ ]],
371
+
372
+ uniform bool coat_normal_image_flip_b_channel = false [[
373
+ anno::display_name("Normal Map Flip B Channel"),
374
+ anno::in_group("Coat")
375
+ ]],
376
+
377
+ //Emission
378
+ //
379
+ float emission_weight = float(0.0) [[
380
+ anno::display_name("Weight"),
381
+ anno::in_group("Emission"),
382
+ anno::hard_range(0.0f, 1.0f)
383
+ ]],
384
+
385
+ uniform texture_2d emission_weight_image = texture_2d() [[
386
+ anno::display_name("Weight Image"),
387
+ anno::in_group("Emission"),
388
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
389
+ ]],
390
+
391
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_weight_image_alpha_mode =
392
+ ::OmniSurface::OmniImage::alpha_default [[
393
+ anno::display_name("Weight Image Alpha Mode"),
394
+ anno::in_group("Emission")
395
+ ]],
396
+
397
+ uniform ::OmniSurface::OmniShared::emission_mode emission_mode =
398
+ ::OmniSurface::OmniShared::emission_lx
399
+ [[
400
+ anno::display_name("Emission Mode"),
401
+ anno::in_group("Emission")
402
+ ]],
403
+
404
+ float emission_intensity = float(1.0) [[
405
+ anno::display_name("Intensity"),
406
+ anno::in_group("Emission"),
407
+ anno::soft_range(0.0f, 1000.0f)
408
+ ]],
409
+
410
+ uniform texture_2d emission_intensity_image = texture_2d() [[
411
+ anno::display_name("Intensity Image"),
412
+ anno::in_group("Emission"),
413
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
414
+ ]],
415
+
416
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_intensity_image_alpha_mode =
417
+ ::OmniSurface::OmniImage::alpha_default [[
418
+ anno::display_name("Intensity Image Alpha Mode"),
419
+ anno::in_group("Emission")
420
+ ]],
421
+
422
+ color emission_color = color(1.0) [[
423
+ anno::display_name("Color"),
424
+ anno::in_group("Emission")
425
+ ]],
426
+
427
+ uniform texture_2d emission_color_image = texture_2d() [[
428
+ anno::display_name("Color Image"),
429
+ anno::in_group("Emission")
430
+ ]],
431
+
432
+ uniform bool emission_use_temperature = false [[
433
+ anno::display_name("Use Temperature"),
434
+ anno::in_group("Emission")
435
+ ]],
436
+
437
+ float emission_temperature = float(6500.0) [[
438
+ anno::display_name("Temperature (kelvin)"),
439
+ anno::in_group("Emission"),
440
+ anno::soft_range(0.0f, 10000.0f)
441
+ ]],
442
+
443
+ uniform texture_2d emission_temperature_image = texture_2d() [[
444
+ anno::display_name("Temperature Image"),
445
+ anno::in_group("Emission"),
446
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
447
+ ]],
448
+
449
+ uniform ::OmniSurface::OmniImage::alpha_mode emission_temperature_image_alpha_mode =
450
+ ::OmniSurface::OmniImage::alpha_default [[
451
+ anno::display_name("Temperature Image Alpha Mode"),
452
+ anno::in_group("Emission")
453
+ ]],
454
+
455
+ //Geometry
456
+ //
457
+ uniform bool enable_opacity = false [[
458
+ anno::display_name("Enable Opacity"),
459
+ anno::description("Enables the use of cutout opacity"),
460
+ anno::in_group("Geometry")
461
+ ]],
462
+
463
+ float geometry_opacity = float(1.0) [[
464
+ anno::display_name("Opacity"),
465
+ anno::in_group("Geometry"),
466
+ anno::hard_range(0.0f, 1.0f)
467
+ ]],
468
+
469
+ uniform texture_2d geometry_opacity_image = texture_2d() [[
470
+ anno::display_name("Opacity Image"),
471
+ anno::in_group("Geometry"),
472
+ anno::usage("opacity")
473
+ ]],
474
+
475
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_opacity_image_alpha_mode =
476
+ ::OmniSurface::OmniImage::alpha_default [[
477
+ anno::display_name("Opacity Image Alpha Mode"),
478
+ anno::in_group("Geometry")
479
+ ]],
480
+
481
+ uniform float geometry_opacity_threshold = float(0.0) [[
482
+ anno::display_name("Opacity Threshold"),
483
+ anno::description("If > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
484
+ anno::in_group("Geometry"),
485
+ anno::hard_range(0.0f, 1.0f)
486
+ ]],
487
+
488
+ uniform float geometry_normal_strength = float(1.0) [[
489
+ anno::display_name("Geometry Normal Strength"),
490
+ anno::in_group("Geometry"),
491
+ anno::soft_range(0.0f, 1.0f),
492
+ anno::hard_range(0.0f, limits::FLOAT_MAX)
493
+ ]],
494
+
495
+ uniform float geometry_normal_roughness_strength = float(1.0) [[
496
+ anno::display_name("Geometry Normal Roughness Strength"),
497
+ anno::in_group("Geometry"),
498
+ anno::hard_range(0.0f, 1.0f)
499
+ ]],
500
+
501
+ float3 geometry_normal = state::normal() [[
502
+ anno::display_name("Geometry Normal"),
503
+ anno::in_group("Geometry"),
504
+ anno::usage("normal")
505
+ ]],
506
+
507
+ uniform texture_2d geometry_normal_image = texture_2d() [[
508
+ anno::display_name("Geometry Normal Map Image"),
509
+ anno::in_group("Geometry"),
510
+ anno::usage("normal")
511
+ ]],
512
+
513
+ uniform bool geometry_normal_image_flip_r_channel = false [[
514
+ anno::display_name("Normal Map Flip R Channel"),
515
+ anno::in_group("Geometry")
516
+ ]],
517
+
518
+ uniform bool geometry_normal_image_flip_g_channel = false [[
519
+ anno::display_name("Normal Map Flip G Channel"),
520
+ anno::in_group("Geometry")
521
+ ]],
522
+
523
+ uniform bool geometry_normal_image_flip_b_channel = false [[
524
+ anno::display_name("Normal Map Flip B Channel"),
525
+ anno::in_group("Geometry")
526
+ ]],
527
+
528
+ uniform ::OmniSurface::OmniImage::tangent_bitangent_mapping geometry_tangent_bitangent_mapping =
529
+ ::OmniSurface::OmniImage::red_green [[
530
+ anno::display_name("Tangent Bitangent Mapping"),
531
+ anno::in_group("Geometry")
532
+ ]],
533
+
534
+ //Displacement
535
+ float3 geometry_displacement = float3(0.0) [[
536
+ anno::display_name("Displacement"),
537
+ anno::in_group("Geometry")
538
+ ]],
539
+
540
+ uniform ::OmniSurface::OmniShared::displacement_mode geometry_displacement_mode =
541
+ ::OmniSurface::OmniShared::displacement_height [[
542
+ anno::display_name("Displacement Mode"),
543
+ anno::in_group("Geometry")
544
+ ]],
545
+
546
+ uniform texture_2d geometry_displacement_image = texture_2d() [[
547
+ anno::display_name("Displacement Image"),
548
+ anno::in_group("Geometry"),
549
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
550
+ ]],
551
+
552
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_image_alpha_mode =
553
+ ::OmniSurface::OmniImage::alpha_default [[
554
+ anno::display_name("Displacement Image Alpha Mode"),
555
+ anno::in_group("Geometry")
556
+ ]],
557
+
558
+ float geometry_displacement_scale = float(1.0) [[
559
+ anno::display_name("Displacement Scale"),
560
+ anno::in_group("Geometry"),
561
+ anno::soft_range(0.0f, 1.0f)
562
+ ]],
563
+
564
+ uniform texture_2d geometry_displacement_scale_image = texture_2d() [[
565
+ anno::display_name("Displacement Scale Image"),
566
+ anno::in_group("Geometry"),
567
+ anno::usage("occlusion") // Don't have usage type for scalar maps. Substituting for now.
568
+ ]],
569
+
570
+ uniform ::OmniSurface::OmniImage::alpha_mode geometry_displacement_scale_image_alpha_mode =
571
+ ::OmniSurface::OmniImage::alpha_default [[
572
+ anno::display_name("Displacement Scale Image Alpha Mode"),
573
+ anno::in_group("Geometry")
574
+ ]],
575
+
576
+ float geometry_displacement_scalar_zero_value = float(0.0) [[
577
+ anno::display_name("Displacement Scalar Zero Value"),
578
+ anno::in_group("Geometry"),
579
+ anno::soft_range(0.0f, 1.0f)
580
+ ]],
581
+
582
+ //UVW
583
+ //
584
+ uniform base::texture_coordinate_system uvw_texture_coordinate_system =
585
+ base::texture_coordinate_uvw [[
586
+ anno::display_name("Texture Coordinate"),
587
+ anno::in_group("UVW Coordinates")
588
+ ]],
589
+
590
+ uniform int uvw_uv_set = 0 [[
591
+ anno::display_name("UV Set"),
592
+ anno::in_group("UVW Coordinates"),
593
+ anno::hard_range(0, 4)
594
+ ]],
595
+
596
+ uniform bool uvw_ignore_missing_textures = false [[
597
+ anno::display_name("Ignore Missing Images"),
598
+ anno::in_group("UVW Coordinates")
599
+ ]],
600
+
601
+ color uvw_missing_texture_color = color(0.0, 0.0, 0.0) [[
602
+ anno::display_name("Missing Image Color"),
603
+ anno::in_group("UVW Coordinates")
604
+ ]],
605
+
606
+ uniform bool uvw_use_uv_coords = false [[
607
+ anno::display_name("Use UV Coords"),
608
+ anno::in_group("UVW Coordinates")
609
+ ]],
610
+
611
+ float2 uvw_uv_coords = float2(0.0) [[
612
+ anno::display_name("UV Coords"),
613
+ anno::in_group("UVW Coordinates")
614
+ ]],
615
+
616
+ uniform float uvw_s_offset = 0.0f [[
617
+ anno::display_name("Offset U"),
618
+ anno::in_group("UVW Coordinates"),
619
+ anno::soft_range(-1.0f, 1.0f)
620
+ ]],
621
+
622
+ uniform float uvw_t_offset = 0.0f [[
623
+ anno::display_name("Offset V"),
624
+ anno::in_group("UVW Coordinates"),
625
+ anno::soft_range(-1.0f, 1.0f)
626
+ ]],
627
+
628
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_s_wrap =
629
+ ::OmniSurface::OmniImage::wrap_periodic [[
630
+ anno::display_name("Wrap U"),
631
+ anno::in_group("UVW Coordinates")
632
+ ]],
633
+
634
+ uniform ::OmniSurface::OmniImage::wrap_mode uvw_t_wrap =
635
+ ::OmniSurface::OmniImage::wrap_periodic [[
636
+ anno::display_name("Wrap V"),
637
+ anno::in_group("UVW Coordinates")
638
+ ]],
639
+
640
+ uniform float uvw_s_scale = 1.0f [[
641
+ anno::display_name("Scale U"),
642
+ anno::in_group("UVW Coordinates"),
643
+ anno::soft_range(0.0f, 100.0f)
644
+ ]],
645
+
646
+ uniform float uvw_t_scale = 1.0f [[
647
+ anno::display_name("Scale V"),
648
+ anno::in_group("UVW Coordinates"),
649
+ anno::soft_range(0.0f, 100.0f)
650
+ ]],
651
+
652
+ uniform bool uvw_s_flip = false [[
653
+ anno::display_name("Flip U"),
654
+ anno::in_group("UVW Coordinates")
655
+ ]],
656
+
657
+ uniform bool uvw_t_flip = false [[
658
+ anno::display_name("Flip V"),
659
+ anno::in_group("UVW Coordinates")
660
+ ]],
661
+
662
+ uniform bool uvw_swap_st = false [[
663
+ anno::display_name("Swap UV"),
664
+ anno::in_group("UVW Coordinates")
665
+ ]],
666
+
667
+ //Projection Coordinates (Local / World)
668
+ uniform ::OmniSurface::OmniImage::projection_mode uvw_projection_mode =
669
+ ::OmniSurface::OmniImage::projection_cubic [[
670
+ anno::display_name("Projection Mode"),
671
+ anno::in_group("UVW Coordinates")
672
+ ]],
673
+
674
+ uniform float3 uvw_projection_translate = float3(0.0) [[
675
+ anno::display_name("Translate"),
676
+ anno::description("Translate the projected texture."),
677
+ anno::in_group("UVW Coordinates")
678
+ ]],
679
+
680
+ uniform float3 uvw_projection_rotate = float3(0.0) [[
681
+ anno::display_name("Rotate"),
682
+ anno::description("Rotate the projected texture."),
683
+ anno::in_group("UVW Coordinates")
684
+ ]],
685
+
686
+ uniform float3 uvw_projection_scale = float3(1.0) [[
687
+ anno::display_name("Scale"),
688
+ anno::description("Scale the projected texture."),
689
+ anno::in_group("UVW Coordinates")
690
+ ]]
691
+ )
692
+ [[
693
+ anno::display_name("OmniSurfaceLite"),
694
+ anno::description("A base material for modeling a variety of surfaces."),
695
+ anno::author("NVIDIA Corporation"),
696
+ anno::key_words(string[]("generic", "surface")),
697
+ anno::version(1, 0, 0, ""),
698
+ anno::in_group("Advanced")
699
+ ]] = let {
700
+
701
+ base::texture_coordinate_info texture_coordinate_info =
702
+ ::OmniSurface::OmniImage::compute_texture_coordinate_2(
703
+ uvw_texture_coordinate_system,
704
+ uvw_uv_set,
705
+ uvw_s_offset,
706
+ uvw_t_offset,
707
+ uvw_s_scale,
708
+ uvw_t_scale,
709
+ uvw_s_flip,
710
+ uvw_t_flip,
711
+ uvw_swap_st,
712
+ uvw_projection_mode,
713
+ uvw_projection_translate,
714
+ uvw_projection_rotate,
715
+ uvw_projection_scale);
716
+
717
+ ::OmniSurface::OmniImage::normal_roughness_data geometry_normal_roughness_data =
718
+ tex::texture_isvalid(geometry_normal_image) ?
719
+ ::OmniSurface::OmniImage::tangent_space_normal_roughness_lookup_2(
720
+ geometry_normal_image,
721
+ uvw_ignore_missing_textures,
722
+ uvw_use_uv_coords,
723
+ uvw_uv_coords,
724
+ uvw_s_wrap,
725
+ uvw_t_wrap,
726
+ uvw_s_flip,
727
+ uvw_t_flip,
728
+ geometry_normal_strength,
729
+ geometry_normal_image_flip_r_channel,
730
+ geometry_normal_image_flip_g_channel,
731
+ geometry_normal_image_flip_b_channel,
732
+ texture_coordinate_info
733
+ ) :
734
+ ::OmniSurface::OmniImage::normal_roughness_data(geometry_normal, float2(0.0));
735
+
736
+ material base = ::OmniSurface::OmniSurfaceLiteBase::OmniSurfaceLiteBase (
737
+
738
+ //Base
739
+ //
740
+ diffuse_reflection_weight: tex::texture_isvalid(diffuse_reflection_weight_image) ?
741
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
742
+ ::OmniSurface::OmniImage::texture_lookup_2(
743
+ diffuse_reflection_weight_image,
744
+ uvw_ignore_missing_textures,
745
+ uvw_missing_texture_color,
746
+ uvw_use_uv_coords,
747
+ uvw_uv_coords,
748
+ uvw_s_wrap,
749
+ uvw_t_wrap,
750
+ texture_coordinate_info
751
+ ),
752
+ diffuse_reflection_weight_image_alpha_mode
753
+ ).mono :
754
+ diffuse_reflection_weight,
755
+
756
+ diffuse_reflection_color: tex::texture_isvalid(diffuse_reflection_color_image) ?
757
+ ::OmniSurface::OmniImage::texture_lookup_2(
758
+ diffuse_reflection_color_image,
759
+ uvw_ignore_missing_textures,
760
+ uvw_missing_texture_color,
761
+ uvw_use_uv_coords,
762
+ uvw_uv_coords,
763
+ uvw_s_wrap,
764
+ uvw_t_wrap,
765
+ texture_coordinate_info
766
+ ).tint :
767
+ diffuse_reflection_color,
768
+
769
+ diffuse_reflection_roughness: tex::texture_isvalid(diffuse_reflection_roughness_image) ?
770
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
771
+ ::OmniSurface::OmniImage::texture_lookup_2(
772
+ diffuse_reflection_roughness_image,
773
+ uvw_ignore_missing_textures,
774
+ uvw_missing_texture_color,
775
+ uvw_use_uv_coords,
776
+ uvw_uv_coords,
777
+ uvw_s_wrap,
778
+ uvw_t_wrap,
779
+ texture_coordinate_info
780
+ ),
781
+ diffuse_reflection_roughness_image_alpha_mode
782
+ ).mono :
783
+ diffuse_reflection_roughness,
784
+
785
+ //Metalness
786
+ //
787
+ metalness: tex::texture_isvalid(metalness_image) ?
788
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
789
+ ::OmniSurface::OmniImage::texture_lookup_2(
790
+ metalness_image,
791
+ uvw_ignore_missing_textures,
792
+ uvw_missing_texture_color,
793
+ uvw_use_uv_coords,
794
+ uvw_uv_coords,
795
+ uvw_s_wrap,
796
+ uvw_t_wrap,
797
+ texture_coordinate_info
798
+ ),
799
+ metalness_image_alpha_mode
800
+ ).mono :
801
+ metalness,
802
+
803
+ //Specular reflection
804
+ //
805
+ specular_reflection_weight: tex::texture_isvalid(specular_reflection_weight_image) ?
806
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
807
+ ::OmniSurface::OmniImage::texture_lookup_2(
808
+ specular_reflection_weight_image,
809
+ uvw_ignore_missing_textures,
810
+ uvw_missing_texture_color,
811
+ uvw_use_uv_coords,
812
+ uvw_uv_coords,
813
+ uvw_s_wrap,
814
+ uvw_t_wrap,
815
+ texture_coordinate_info
816
+ ),
817
+ specular_reflection_weight_image_alpha_mode
818
+ ).mono :
819
+ specular_reflection_weight,
820
+
821
+ specular_reflection_color: tex::texture_isvalid(specular_reflection_color_image) ?
822
+ ::OmniSurface::OmniImage::texture_lookup_2(
823
+ specular_reflection_color_image,
824
+ uvw_ignore_missing_textures,
825
+ uvw_missing_texture_color,
826
+ uvw_use_uv_coords,
827
+ uvw_uv_coords,
828
+ uvw_s_wrap,
829
+ uvw_t_wrap,
830
+ texture_coordinate_info
831
+ ).tint :
832
+ specular_reflection_color,
833
+
834
+ specular_reflection_roughness: tex::texture_isvalid(specular_reflection_roughness_image) ?
835
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
836
+ ::OmniSurface::OmniImage::texture_lookup_2(
837
+ specular_reflection_roughness_image,
838
+ uvw_ignore_missing_textures,
839
+ uvw_missing_texture_color,
840
+ uvw_use_uv_coords,
841
+ uvw_uv_coords,
842
+ uvw_s_wrap,
843
+ uvw_t_wrap,
844
+ texture_coordinate_info
845
+ ),
846
+ specular_reflection_roughness_image_alpha_mode
847
+ ).mono :
848
+ specular_reflection_roughness,
849
+
850
+ specular_reflection_ior_preset: specular_reflection_ior_preset,
851
+ specular_reflection_ior: specular_reflection_ior,
852
+
853
+ specular_reflection_anisotropy: tex::texture_isvalid(specular_reflection_anisotropy_image) ?
854
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
855
+ ::OmniSurface::OmniImage::texture_lookup_2(
856
+ specular_reflection_anisotropy_image,
857
+ uvw_ignore_missing_textures,
858
+ uvw_missing_texture_color,
859
+ uvw_use_uv_coords,
860
+ uvw_uv_coords,
861
+ uvw_s_wrap,
862
+ uvw_t_wrap,
863
+ texture_coordinate_info
864
+ ),
865
+ specular_reflection_anisotropy_image_alpha_mode
866
+ ).mono :
867
+ specular_reflection_anisotropy,
868
+
869
+ specular_reflection_anisotropy_rotation: tex::texture_isvalid(
870
+ specular_reflection_anisotropy_rotation_image) ?
871
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
872
+ ::OmniSurface::OmniImage::texture_lookup_2(
873
+ specular_reflection_anisotropy_rotation_image,
874
+ uvw_ignore_missing_textures,
875
+ uvw_missing_texture_color,
876
+ uvw_use_uv_coords,
877
+ uvw_uv_coords,
878
+ uvw_s_wrap,
879
+ uvw_t_wrap,
880
+ texture_coordinate_info
881
+ ),
882
+ specular_reflection_anisotropy_rotation_image_alpha_mode
883
+ ).mono :
884
+ specular_reflection_anisotropy_rotation,
885
+
886
+ //Coat
887
+ //
888
+ coat_weight: tex::texture_isvalid(coat_weight_image) ?
889
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
890
+ ::OmniSurface::OmniImage::texture_lookup_2(
891
+ coat_weight_image,
892
+ uvw_ignore_missing_textures,
893
+ uvw_missing_texture_color,
894
+ uvw_use_uv_coords,
895
+ uvw_uv_coords,
896
+ uvw_s_wrap,
897
+ uvw_t_wrap,
898
+ texture_coordinate_info
899
+ ),
900
+ coat_weight_image_alpha_mode
901
+ ).mono :
902
+ coat_weight,
903
+
904
+ coat_color: tex::texture_isvalid(coat_color_image) ?
905
+ ::OmniSurface::OmniImage::texture_lookup_2(
906
+ coat_color_image,
907
+ uvw_ignore_missing_textures,
908
+ uvw_missing_texture_color,
909
+ uvw_use_uv_coords,
910
+ uvw_uv_coords,
911
+ uvw_s_wrap,
912
+ uvw_t_wrap,
913
+ texture_coordinate_info
914
+ ).tint :
915
+ coat_color,
916
+
917
+ coat_roughness: tex::texture_isvalid(coat_roughness_image) ?
918
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
919
+ ::OmniSurface::OmniImage::texture_lookup_2(
920
+ coat_roughness_image,
921
+ uvw_ignore_missing_textures,
922
+ uvw_missing_texture_color,
923
+ uvw_use_uv_coords,
924
+ uvw_uv_coords,
925
+ uvw_s_wrap,
926
+ uvw_t_wrap,
927
+ texture_coordinate_info
928
+ ),
929
+ coat_roughness_image_alpha_mode
930
+ ).mono :
931
+ coat_roughness,
932
+
933
+ coat_ior_preset: coat_ior_preset,
934
+ coat_ior: coat_ior,
935
+
936
+ coat_anisotropy: tex::texture_isvalid(coat_anisotropy_image) ?
937
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
938
+ ::OmniSurface::OmniImage::texture_lookup_2(
939
+ coat_anisotropy_image,
940
+ uvw_ignore_missing_textures,
941
+ uvw_missing_texture_color,
942
+ uvw_use_uv_coords,
943
+ uvw_uv_coords,
944
+ uvw_s_wrap,
945
+ uvw_t_wrap,
946
+ texture_coordinate_info
947
+ ),
948
+ coat_anisotropy_image_alpha_mode
949
+ ).mono :
950
+ coat_anisotropy,
951
+
952
+ coat_anisotropy_rotation: tex::texture_isvalid(coat_anisotropy_rotation_image) ?
953
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
954
+ ::OmniSurface::OmniImage::texture_lookup_2(
955
+ coat_anisotropy_rotation_image,
956
+ uvw_ignore_missing_textures,
957
+ uvw_missing_texture_color,
958
+ uvw_use_uv_coords,
959
+ uvw_uv_coords,
960
+ uvw_s_wrap,
961
+ uvw_t_wrap,
962
+ texture_coordinate_info
963
+ ),
964
+ coat_anisotropy_rotation_image_alpha_mode
965
+ ).mono :
966
+ coat_anisotropy_rotation,
967
+
968
+ coat_affect_color: tex::texture_isvalid(coat_affect_color_image) ?
969
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
970
+ ::OmniSurface::OmniImage::texture_lookup_2(
971
+ coat_affect_color_image,
972
+ uvw_ignore_missing_textures,
973
+ uvw_missing_texture_color,
974
+ uvw_use_uv_coords,
975
+ uvw_uv_coords,
976
+ uvw_s_wrap,
977
+ uvw_t_wrap,
978
+ texture_coordinate_info
979
+ ),
980
+ coat_affect_color_image_alpha_mode
981
+ ).mono :
982
+ coat_affect_color,
983
+
984
+ coat_affect_roughness: tex::texture_isvalid(coat_affect_roughness_image) ?
985
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
986
+ ::OmniSurface::OmniImage::texture_lookup_2(
987
+ coat_affect_roughness_image,
988
+ uvw_ignore_missing_textures,
989
+ uvw_missing_texture_color,
990
+ uvw_use_uv_coords,
991
+ uvw_uv_coords,
992
+ uvw_s_wrap,
993
+ uvw_t_wrap,
994
+ texture_coordinate_info
995
+ ),
996
+ coat_affect_roughness_image_alpha_mode
997
+ ).mono :
998
+ coat_affect_roughness,
999
+
1000
+ coat_normal: tex::texture_isvalid(coat_normal_image) ?
1001
+ ::OmniSurface::OmniImage::normal_mapping(
1002
+ ::OmniSurface::OmniImage::tangent_space_normal_lookup_2(
1003
+ coat_normal_image,
1004
+ uvw_ignore_missing_textures,
1005
+ uvw_use_uv_coords,
1006
+ uvw_uv_coords,
1007
+ uvw_s_wrap,
1008
+ uvw_t_wrap,
1009
+ uvw_s_flip,
1010
+ uvw_t_flip,
1011
+ coat_normal_strength,
1012
+ coat_normal_image_flip_r_channel,
1013
+ coat_normal_image_flip_g_channel,
1014
+ coat_normal_image_flip_b_channel,
1015
+ texture_coordinate_info
1016
+ ),
1017
+ geometry_tangent_bitangent_mapping,
1018
+ coat_normal
1019
+ ):
1020
+ coat_normal,
1021
+
1022
+ //Emission
1023
+ //
1024
+ emission_weight: tex::texture_isvalid(emission_weight_image) ?
1025
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1026
+ ::OmniSurface::OmniImage::texture_lookup_2(
1027
+ emission_weight_image,
1028
+ uvw_ignore_missing_textures,
1029
+ uvw_missing_texture_color,
1030
+ uvw_use_uv_coords,
1031
+ uvw_uv_coords,
1032
+ uvw_s_wrap,
1033
+ uvw_t_wrap,
1034
+ texture_coordinate_info
1035
+ ),
1036
+ emission_weight_image_alpha_mode
1037
+ ).mono :
1038
+ emission_weight,
1039
+
1040
+ emission_mode: emission_mode,
1041
+
1042
+ emission_intensity: tex::texture_isvalid(emission_intensity_image) ?
1043
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1044
+ ::OmniSurface::OmniImage::texture_lookup_2(
1045
+ emission_intensity_image,
1046
+ uvw_ignore_missing_textures,
1047
+ uvw_missing_texture_color,
1048
+ uvw_use_uv_coords,
1049
+ uvw_uv_coords,
1050
+ uvw_s_wrap,
1051
+ uvw_t_wrap,
1052
+ texture_coordinate_info
1053
+ ),
1054
+ emission_intensity_image_alpha_mode
1055
+ ).mono :
1056
+ emission_intensity,
1057
+
1058
+ emission_color: tex::texture_isvalid(emission_color_image) ?
1059
+ ::OmniSurface::OmniImage::texture_lookup_2(
1060
+ emission_color_image,
1061
+ uvw_ignore_missing_textures,
1062
+ uvw_missing_texture_color,
1063
+ uvw_use_uv_coords,
1064
+ uvw_uv_coords,
1065
+ uvw_s_wrap,
1066
+ uvw_t_wrap,
1067
+ texture_coordinate_info
1068
+ ).tint :
1069
+ emission_color,
1070
+
1071
+ emission_use_temperature: emission_use_temperature,
1072
+
1073
+ emission_temperature: tex::texture_isvalid(emission_temperature_image) ?
1074
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1075
+ ::OmniSurface::OmniImage::texture_lookup_2(
1076
+ emission_temperature_image,
1077
+ uvw_ignore_missing_textures,
1078
+ uvw_missing_texture_color,
1079
+ uvw_use_uv_coords,
1080
+ uvw_uv_coords,
1081
+ uvw_s_wrap,
1082
+ uvw_t_wrap,
1083
+ texture_coordinate_info
1084
+ ),
1085
+ emission_temperature_image_alpha_mode
1086
+ ).mono :
1087
+ emission_temperature,
1088
+
1089
+ //Geometry
1090
+ //
1091
+ enable_opacity: enable_opacity,
1092
+
1093
+ geometry_opacity: tex::texture_isvalid(geometry_opacity_image) ?
1094
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1095
+ ::OmniSurface::OmniImage::texture_lookup_2(
1096
+ geometry_opacity_image,
1097
+ uvw_ignore_missing_textures,
1098
+ uvw_missing_texture_color,
1099
+ uvw_use_uv_coords,
1100
+ uvw_uv_coords,
1101
+ uvw_s_wrap,
1102
+ uvw_t_wrap,
1103
+ texture_coordinate_info
1104
+ ),
1105
+ geometry_opacity_image_alpha_mode
1106
+ ).mono :
1107
+ geometry_opacity,
1108
+
1109
+ geometry_opacity_threshold: geometry_opacity_threshold,
1110
+
1111
+ geometry_normal_roughness_strength: geometry_normal_roughness_strength,
1112
+
1113
+ geometry_normal_roughness: geometry_normal_roughness_data.roughness,
1114
+
1115
+ geometry_normal: ::OmniSurface::OmniImage::normal_mapping(
1116
+ geometry_normal_roughness_data.normal,
1117
+ geometry_tangent_bitangent_mapping,
1118
+ geometry_normal),
1119
+
1120
+ geometry_displacement: tex::texture_isvalid(geometry_displacement_image) ?
1121
+ ::OmniSurface::OmniShared::displacement_adjustment(
1122
+ (geometry_displacement_mode == ::OmniSurface::OmniShared::displacement_height) ?
1123
+ float3(::OmniSurface::OmniImage::texture_adjustment_2(
1124
+ OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1125
+ ::OmniSurface::OmniImage::texture_lookup_2(
1126
+ geometry_displacement_image,
1127
+ uvw_ignore_missing_textures,
1128
+ uvw_missing_texture_color,
1129
+ uvw_use_uv_coords,
1130
+ uvw_uv_coords,
1131
+ uvw_s_wrap,
1132
+ uvw_t_wrap,
1133
+ texture_coordinate_info
1134
+ ),
1135
+ geometry_displacement_image_alpha_mode
1136
+ ),
1137
+ 0.0f, //exposure
1138
+ color(0.5), //default_color
1139
+ color(1.0), //color_gain
1140
+ color(0.0), //color_offset
1141
+ 1.0f, //alpha_gain
1142
+ -1.0f * geometry_displacement_scalar_zero_value, //alpha_offset
1143
+ false, //invert
1144
+ 0.0f //blend_factor
1145
+ ).mono) :
1146
+
1147
+ float3(::OmniSurface::OmniImage::texture_lookup_2(
1148
+ geometry_displacement_image,
1149
+ uvw_ignore_missing_textures,
1150
+ uvw_missing_texture_color,
1151
+ uvw_use_uv_coords,
1152
+ uvw_uv_coords,
1153
+ uvw_s_wrap,
1154
+ uvw_t_wrap,
1155
+ texture_coordinate_info
1156
+ ).tint
1157
+ ),
1158
+
1159
+ geometry_displacement_mode,
1160
+
1161
+ tex::texture_isvalid(geometry_displacement_scale_image) ?
1162
+ ::OmniSurface::OmniImage::texture_alpha_channel_remap_2(
1163
+ ::OmniSurface::OmniImage::texture_lookup_2(
1164
+ geometry_displacement_scale_image,
1165
+ uvw_ignore_missing_textures,
1166
+ uvw_missing_texture_color,
1167
+ uvw_use_uv_coords,
1168
+ uvw_uv_coords,
1169
+ uvw_s_wrap,
1170
+ uvw_t_wrap,
1171
+ texture_coordinate_info
1172
+ ),
1173
+ geometry_displacement_scale_image_alpha_mode
1174
+ ).mono :
1175
+ geometry_displacement_scale
1176
+ ):
1177
+ geometry_displacement
1178
+ );
1179
+
1180
+ } in material(
1181
+ thin_walled: base.thin_walled,
1182
+ ior: base.ior,
1183
+ surface: base.surface,
1184
+ backface: base.backface,
1185
+ volume: base.volume,
1186
+ geometry: base.geometry
1187
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/OmniSurfacePresets.mdl ADDED
The diff for this file is too large to render. See raw diff
 
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/materials/pbr.mdl ADDED
@@ -0,0 +1,910 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 2022 NVIDIA Corporation. All rights reserved.
3
+ *
4
+ * Redistribution and use in source and binary forms, with or without
5
+ * modification, are permitted provided that the following conditions
6
+ * are met:
7
+ * * Redistributions of source code must retain the above copyright
8
+ * notice, this list of conditions and the following disclaimer.
9
+ * * Redistributions in binary form must reproduce the above copyright
10
+ * notice, this list of conditions and the following disclaimer in the
11
+ * documentation and/or other materials provided with the distribution.
12
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
13
+ * contributors may be used to endorse or promote products derived
14
+ * from this software without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ *****************************************************************************/
28
+
29
+ mdl 1.8;
30
+
31
+ import ::anno::*;
32
+ import ::base::*;
33
+ import ::df::*;
34
+ import ::math::*;
35
+ import ::state::*;
36
+ import ::tex::*;
37
+ import ::scene::*;
38
+ import ::limits::*;
39
+
40
+ export enum gltf_alpha_mode {
41
+ opaque,
42
+ mask,
43
+ blend
44
+ };
45
+
46
+ export enum gltf_wrapping_mode {
47
+ clamp_to_edge = 33071,
48
+ mirrored_repeat = 33648,
49
+ repeat = 10497
50
+ };
51
+
52
+ export struct gltf_texture_lookup_value
53
+ {
54
+ bool valid = false;
55
+ float4 value = float4(0.0, 0.0, 0.0, 1.0);
56
+ };
57
+
58
+ export struct gltf_normal_texture_lookup_value
59
+ {
60
+ bool valid = false;
61
+ float3 value = float3(0.0);
62
+ };
63
+
64
+ float compute_opacity(gltf_alpha_mode mode, float alpha, float cutoff) {
65
+ switch (mode) {
66
+ case mask:
67
+ return alpha < cutoff ? 0.0 : 1.0;
68
+ case blend:
69
+ return alpha;
70
+ case opaque:
71
+ return 1.0;
72
+ }
73
+ }
74
+
75
+ float4 gltf_prepare_tex_float4(gltf_texture_lookup_value sample) {
76
+ return sample.valid ? sample.value : float4(1.0);
77
+ }
78
+
79
+ float3 gltf_prepare_tex_float3(gltf_texture_lookup_value sample) {
80
+ return sample.valid ? float3(sample.value.x, sample.value.y, sample.value.z) : float3(1.0);
81
+ }
82
+
83
+ float3 gltf_prepare_normal(gltf_normal_texture_lookup_value sample) {
84
+ return sample.valid ? sample.value : state::normal();
85
+ }
86
+
87
+ float gltf_prepare_occlusion(gltf_texture_lookup_value sample, float occlusion_strength) {
88
+ float occulusion = sample.valid ? sample.value.x : 1.0;
89
+ return math::lerp(1.0, occulusion, occlusion_strength);
90
+ }
91
+
92
+ color gltf_perpare_emission(gltf_texture_lookup_value sample, color emissive_factor) {
93
+ return emissive_factor * color(gltf_prepare_tex_float3(sample));
94
+ }
95
+
96
+ ::tex::wrap_mode convert_wrap_mode(gltf_wrapping_mode mode)
97
+ {
98
+ if (mode == clamp_to_edge)
99
+ return ::tex::wrap_clamp;
100
+ if (mode == mirrored_repeat)
101
+ return ::tex::wrap_mirrored_repeat;
102
+
103
+ return ::tex::wrap_repeat;
104
+ }
105
+
106
+ float2 khr_texture_transform_apply(
107
+ float2 coord,
108
+ float2 offset,
109
+ float rotation,
110
+ float2 scale
111
+ )
112
+ {
113
+ // MDL expects the texture coordinate origin at the bottom left (gltf at top left)
114
+ // Assuming the renderer follows the MDL specification in which case the coordinates
115
+ // have been flipped either while loading the glTF geometry or while setting up the state.
116
+
117
+ // Undo the flipping for the transformation to get into the original glTF texture space.
118
+ coord = float2(coord.x, 1.0f - coord.y);
119
+
120
+ // first scale
121
+ coord = coord * scale;
122
+ // then rotate
123
+ float cos_rotation = ::math::cos(rotation);
124
+ float sin_rotation = ::math::sin(rotation);
125
+ coord = float2(cos_rotation * coord.x + sin_rotation * coord.y, cos_rotation * coord.y - sin_rotation * coord.x);
126
+ // then translate
127
+ coord = coord + offset;
128
+
129
+ // flip back
130
+ coord = float2(coord.x, 1.0f - coord.y);
131
+ return coord;
132
+ }
133
+
134
+ export gltf_texture_lookup_value gltf_texture_lookup(
135
+ uniform texture_2d texture = texture_2d()
136
+ [[
137
+ anno::in_group("Source"),
138
+ anno::display_name("Texture"),
139
+ anno::description("Texture File")
140
+ ]],
141
+ uniform int tex_coord_index = 0
142
+ [[
143
+ anno::in_group("Source"),
144
+ anno::display_name("Coordinate Set"),
145
+ anno::description("Texture coordinate set (UV-Set). KHR_texture_transform overrides the textureInfo texCoord value if supplied."),
146
+ anno::enable_if("::tex::texture_isvalid(texture)")
147
+ ]],
148
+
149
+ uniform float2 offset = float2(0.0f, 0.0)
150
+ [[
151
+ anno::in_group("Texture Transform"),
152
+ anno::display_name("Offset"),
153
+ anno::description("The offset of the UV coordinate origin as a factor of the texture dimensions."),
154
+ anno::enable_if("::tex::texture_isvalid(texture)")
155
+ ]],
156
+ uniform float rotation = 0.0
157
+ [[
158
+ anno::hard_range(0.0, 2.0 * ::math::PI),
159
+ anno::in_group("Texture Transform"),
160
+ anno::display_name("Rotation"),
161
+ anno::description("Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise."),
162
+ anno::enable_if("::tex::texture_isvalid(texture)")
163
+ ]],
164
+ uniform float2 scale = float2(1.0f, 1.0f)
165
+ [[
166
+ anno::in_group("Texture Transform"),
167
+ anno::display_name("Scale"),
168
+ anno::description("The scale factor applied to the components of the UV coordinates."),
169
+ anno::enable_if("::tex::texture_isvalid(texture)")
170
+ ]],
171
+
172
+ uniform gltf_wrapping_mode wrap_s = repeat
173
+ [[
174
+ anno::in_group("Sampler"),
175
+ anno::display_name("Wrap S"),
176
+ anno::description("S (U) wrapping mode."),
177
+ anno::enable_if("::tex::texture_isvalid(texture)")
178
+ ]],
179
+ uniform gltf_wrapping_mode wrap_t = repeat
180
+ [[
181
+ anno::in_group("Sampler"),
182
+ anno::display_name("Wrap T"),
183
+ anno::description("T (V) wrapping mode."),
184
+ anno::enable_if("::tex::texture_isvalid(texture)")
185
+ ]]
186
+ )
187
+ [[
188
+ anno::author("NVIDIA Corporation"),
189
+ anno::display_name("GLTF Texture Lookup"),
190
+ anno::description("Function to read a color or color with alpha channel texture.")
191
+ ]]
192
+ {
193
+ gltf_texture_lookup_value tex_ret;
194
+ if (!tex::texture_isvalid(texture))
195
+ return tex_ret;
196
+
197
+ float3 tex_coord3 = state::texture_coordinate(tex_coord_index);
198
+ float2 tex_coord = khr_texture_transform_apply(
199
+ coord: float2(tex_coord3.x, tex_coord3.y),
200
+ offset: offset,
201
+ rotation: rotation,
202
+ scale: scale);
203
+
204
+ tex_ret.value = tex::lookup_float4(
205
+ tex: texture,
206
+ coord: tex_coord,
207
+ wrap_u: convert_wrap_mode(wrap_s),
208
+ wrap_v: convert_wrap_mode(wrap_t));
209
+ tex_ret.valid = true;
210
+ return tex_ret;
211
+ }
212
+
213
+ export gltf_normal_texture_lookup_value gltf_normal_texture_lookup(
214
+ uniform texture_2d texture = texture_2d()
215
+ [[
216
+ anno::in_group("Source"),
217
+ anno::display_name("Texture"),
218
+ anno::description("Texture File")
219
+ ]],
220
+ uniform float normal_scale_factor = 1.0
221
+ [[
222
+ anno::hard_range(0.0, 1.0),
223
+ anno::in_group("Source"),
224
+ anno::display_name("Normal Scale Factor"),
225
+ anno::description("Strength of the base layer normal mapping."),
226
+ anno::enable_if("::tex::texture_isvalid(texture)")
227
+ ]],
228
+ uniform int tex_coord_index = 0
229
+ [[
230
+ anno::in_group("Source"),
231
+ anno::display_name("Coordinate Set"),
232
+ anno::description("Texture coordinate set (UV-Set). KHR_texture_transform overrides the textureInfo texCoord value if supplied."),
233
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
234
+ ]],
235
+ uniform int tex_tangent_index = 0
236
+ [[
237
+ anno::hidden(),
238
+ anno::in_group("Source"),
239
+ anno::display_name("Coordinate Set"),
240
+ anno::description("Tangent to be to construct the tangent frame."),
241
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
242
+ ]],
243
+
244
+ uniform float2 offset = float2(0.0f, 0.0)
245
+ [[
246
+ anno::in_group("Texture Transform"),
247
+ anno::display_name("Offset"),
248
+ anno::description("The offset of the UV coordinate origin as a factor of the texture dimensions."),
249
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
250
+ ]],
251
+ uniform float rotation = 0.0
252
+ [[
253
+ anno::hard_range(0.0, 2.0 * ::math::PI),
254
+ anno::in_group("Texture Transform"),
255
+ anno::display_name("Rotation"),
256
+ anno::description("Rotate the UVs by this many radians counter-clockwise around the origin. This is equivalent to a similar rotation of the image clockwise."),
257
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
258
+ ]],
259
+ uniform float2 scale = float2(1.0f, 1.0f)
260
+ [[
261
+ anno::in_group("Texture Transform"),
262
+ anno::display_name("Scale"),
263
+ anno::description("The scale factor applied to the components of the UV coordinates."),
264
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
265
+ ]],
266
+
267
+ uniform gltf_wrapping_mode wrap_s = repeat
268
+ [[
269
+ anno::in_group("Sampler"),
270
+ anno::display_name("Wrap S"),
271
+ anno::description("S (U) wrapping mode."),
272
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
273
+ ]],
274
+ uniform gltf_wrapping_mode wrap_t = repeat
275
+ [[
276
+ anno::in_group("Sampler"),
277
+ anno::display_name("Wrap T"),
278
+ anno::description("T (V) wrapping mode."),
279
+ anno::enable_if("::tex::texture_isvalid(texture) && normal_scale_factor>0.0")
280
+ ]]
281
+ )
282
+ [[
283
+ anno::author("NVIDIA Corporation"),
284
+ anno::display_name("GLTF Normal Texture Lookup"),
285
+ anno::description("Function to read a normal texture.")
286
+ ]]
287
+ {
288
+ gltf_normal_texture_lookup_value tex_ret;
289
+ if (!::tex::texture_isvalid(texture))
290
+ return tex_ret;
291
+
292
+ float3 tex_coord3 = state::texture_coordinate(tex_coord_index);
293
+ float2 tex_coord = khr_texture_transform_apply(
294
+ coord: float2(tex_coord3.x, tex_coord3.y),
295
+ offset: offset,
296
+ rotation: rotation,
297
+ scale: scale);
298
+
299
+ tex_ret.value = base::tangent_space_normal_texture(
300
+ texture: texture,
301
+ factor: normal_scale_factor,
302
+ uvw: base::texture_coordinate_info(
303
+ position: float3(tex_coord.x, tex_coord.y, tex_coord3.z),
304
+ tangent_u: state::texture_tangent_u(tex_tangent_index),
305
+ tangent_v: state::texture_tangent_v(tex_tangent_index)),
306
+ wrap_u: convert_wrap_mode(wrap_s),
307
+ wrap_v: convert_wrap_mode(wrap_t));
308
+ tex_ret.valid = true;
309
+ return tex_ret;
310
+ }
311
+
312
+ export material gltf_material(
313
+ // base color
314
+ uniform color base_color_factor = color(1.0)
315
+ [[
316
+ anno::in_group("Metallic Roughness"),
317
+ anno::display_name("Base Color Factor"),
318
+ anno::description("The base color of the material. Multiplied to the 'Base Color Texture' if available.")
319
+ ]],
320
+
321
+ gltf_texture_lookup_value base_color_texture = gltf_texture_lookup()
322
+ [[
323
+ anno::in_group("Metallic Roughness"),
324
+ anno::display_name("Base Color Texture"),
325
+ anno::description("The base color of the material. Influenced by the 'Base Color Factor'.")
326
+ ]],
327
+
328
+ // KHR_materials_specular
329
+ uniform float specular_factor = 1.0
330
+ [[
331
+ anno::hard_range(0.0, 1.0),
332
+ anno::in_group("Specular"),
333
+ anno::display_name("Specular Factor"),
334
+ anno::description("The strength of the specular reflection. Multiplied to the 'Specular Texture' if available.")
335
+ ]],
336
+ gltf_texture_lookup_value specular_texture = gltf_texture_lookup()
337
+ [[
338
+ anno::in_group("Specular"),
339
+ anno::display_name("Specular Texture"),
340
+ anno::description("A texture that defines the strength of the specular reflection, stored in the alpha (A) channel. This will be multiplied by the 'Specular Factor'.")
341
+ ]],
342
+ uniform color specular_color_factor = color(1.0)
343
+ [[
344
+ anno::in_group("Specular"),
345
+ anno::display_name("Specular Color Factor"),
346
+ anno::description("The F0 color of the specular reflection (linear RGB). Multiplied to the 'Specular Color Texture' if available.")
347
+ ]],
348
+ gltf_texture_lookup_value specular_color_texture = gltf_texture_lookup()
349
+ [[
350
+ anno::in_group("Specular"),
351
+ anno::display_name("Specular Color Texture"),
352
+ anno::description("A texture that defines the F0 color of the specular reflection, stored in the RGB channels and encoded in sRGB. This texture will be multiplied by 'Specular Color Factor'.")
353
+ ]],
354
+
355
+ // metallic roughness
356
+ uniform float metallic_factor = 1.0
357
+ [[
358
+ anno::hard_range(0.0, 1.0),
359
+ anno::in_group("Metallic Roughness"),
360
+ anno::display_name("Metallic Factor"),
361
+ anno::description("The metalness of the material. Select between dielectric (0.0) and metallic (1.0). Multiplied to the 'Metal/Rough Texture' value if available.")
362
+ ]],
363
+
364
+ uniform float roughness_factor = 1.0
365
+ [[
366
+ anno::hard_range(0.0, 1.0),
367
+ anno::in_group("Metallic Roughness"),
368
+ anno::display_name("Roughness Factor"),
369
+ anno::description("The roughness of the material. Select between very glossy (0.0) and dull (1.0). Multiplied to the 'Metal/Rough Texture' value if available.")
370
+ ]],
371
+ gltf_texture_lookup_value metallic_roughness_texture = gltf_texture_lookup()
372
+ [[
373
+ anno::in_group("Metallic Roughness"),
374
+ anno::display_name("Metal/Rough Texture"),
375
+ anno::description("Metallic in the red or blue component and roughness in the green component. Influenced by the 'Metallic Factor' and 'Roughness Factor'."),
376
+ anno::enable_if("metallic_factor>0.0 || roughness_factor>0.0")
377
+ ]],
378
+
379
+ // KHR_materials_ior
380
+ uniform float ior = 1.5
381
+ [[
382
+ anno::hard_range(1.00, 5.0),
383
+ anno::in_group("Metallic Roughness"),
384
+ anno::display_name("IOR"),
385
+ anno::description("The index of refraction.")
386
+ ]],
387
+
388
+ // normal map
389
+ gltf_normal_texture_lookup_value normal_texture = gltf_normal_texture_lookup()
390
+ [[
391
+ anno::in_group("Normal Mapping"),
392
+ anno::display_name("Normal Texture"),
393
+ anno::description("Base layer normal map.")
394
+ ]],
395
+
396
+ // KHR_materials_transmission
397
+ uniform float transmission_factor = 0.0
398
+ [[
399
+ anno::hard_range(0.0, 1.0),
400
+ anno::in_group("Transmission"),
401
+ anno::display_name("Transmission Factor"),
402
+ anno::description("The base percentage of light that is transmitted through the surface. Multiplied to the 'Transmission Texture' if available.")
403
+ ]],
404
+ gltf_texture_lookup_value transmission_texture = gltf_texture_lookup()
405
+ [[
406
+ anno::in_group("Transmission"),
407
+ anno::display_name("Transmission Texture"),
408
+ anno::description("A texture that defines the transmission percentage of the surface, stored in the R channel. Influenced by the 'Transmission Factor'."),
409
+ anno::enable_if("transmission_factor>0")
410
+ ]],
411
+
412
+ // KHR_materials_sheen
413
+ uniform color sheen_color_factor = color(0.0)
414
+ [[
415
+ anno::in_group("Sheen"),
416
+ anno::display_name("Sheen Color Factor"),
417
+ anno::description("The sheen color in linear space. Multiplied to the 'Sheen Color Texture' if available.")
418
+ ]],
419
+ gltf_texture_lookup_value sheen_color_texture = gltf_texture_lookup()
420
+ [[
421
+ anno::in_group("Sheen"),
422
+ anno::display_name("Sheen Color Texture"),
423
+ anno::description("The sheen color (RGB). The sheen color is in sRGB transfer function. Influenced by the 'Sheen Color Factor'.")
424
+ ]],
425
+ uniform float sheen_roughness_factor = 0.0
426
+ [[
427
+ anno::hard_range(0.0, 1.0),
428
+ anno::in_group("Sheen"),
429
+ anno::display_name("Sheen Roughness Factor"),
430
+ anno::description("The sheen roughness. Multiplied to the 'Sheen Roughness Texture' if available.")
431
+ ]],
432
+ gltf_texture_lookup_value sheen_roughness_texture = gltf_texture_lookup()
433
+ [[
434
+ anno::in_group("Sheen"),
435
+ anno::display_name("Sheen Roughness Texture"),
436
+ anno::description("The sheen roughness (Alpha) texture. Influenced by the 'Sheen Roughness Factor'.")
437
+ ]],
438
+
439
+ // KHR_materials_clearcoat
440
+ uniform float clearcoat_factor = 0.0
441
+ [[
442
+ anno::hard_range(0.0, 1.0),
443
+ anno::in_group("Clearcoat"),
444
+ anno::display_name("Clearcoat Factor"),
445
+ anno::description("Strength of the clearcoat. Multiplied to the 'Clearcoat Texture' if available.")
446
+ ]],
447
+ gltf_texture_lookup_value clearcoat_texture = gltf_texture_lookup()
448
+ [[
449
+ anno::in_group("Clearcoat"),
450
+ anno::display_name("Clearcoat Texture"),
451
+ anno::description("Strength of the clearcoat. Influenced by the 'Clearcoat Factor'."),
452
+ anno::enable_if("clearcoat_factor>0")
453
+ ]],
454
+ uniform float clearcoat_roughness_factor = 0.0
455
+ [[
456
+ anno::hard_range(0.0, 1.0),
457
+ anno::in_group("Clearcoat"),
458
+ anno::display_name("Clearcoat Roughness Factor"),
459
+ anno::description("The clearcoat layer roughness. Multiplied to the 'Clearcoat Roughness Texture' if available."),
460
+ anno::enable_if("clearcoat_factor>0.0")
461
+ ]],
462
+ gltf_texture_lookup_value clearcoat_roughness_texture = gltf_texture_lookup()
463
+ [[
464
+ anno::in_group("Clearcoat"),
465
+ anno::display_name("Clearcoat Roughness Texture"),
466
+ anno::description("The clearcoat layer roughness texture. Influenced by the 'Clearcoat Roughness Texture'."),
467
+ anno::enable_if("clearcoat_factor>0.0 && clearcoat_roughness_factor>0.0")
468
+ ]],
469
+ gltf_normal_texture_lookup_value clearcoat_normal_texture = gltf_normal_texture_lookup()
470
+ [[
471
+ anno::in_group("Clearcoat"),
472
+ anno::display_name("Clearcoat Normal"),
473
+ anno::description("The clearcoat normal map texture."),
474
+ anno::enable_if("clearcoat_factor>0.0")
475
+ ]],
476
+
477
+ // emission
478
+ uniform color emissive_factor = color(0.0)
479
+ [[
480
+ anno::in_group("Emission"),
481
+ anno::display_name("Emissive Factor"),
482
+ anno::description("The emissive color of the material. Multiplied to the 'Emissive Texture' if available.")
483
+ ]],
484
+ gltf_texture_lookup_value emissive_texture = gltf_texture_lookup()
485
+ [[
486
+ anno::in_group("Emission"),
487
+ anno::display_name("Emissive Texture"),
488
+ anno::description("The emissive map texture. Influenced by the 'Emissive Factor'."),
489
+ anno::enable_if("::math::average(emissive_factor)>0.0")
490
+ ]],
491
+ // KHR_materials_emissive_strength
492
+ uniform float emissive_strength = 1.0
493
+ [[
494
+ anno::soft_range(0.0, 1000),
495
+ anno::in_group("Emission"),
496
+ anno::display_name("Emissive Strength"),
497
+ anno::description("The maximum strength of the emissive texture. Multiplied to the 'Emissive Factor'."),
498
+ anno::enable_if("::math::average(emissive_factor)>0.0")
499
+ ]],
500
+
501
+ // KHR_materials_volume
502
+ uniform bool thin_walled = true
503
+ [[
504
+ anno::in_group("Volume"),
505
+ anno::display_name("Thin-walled"),
506
+ anno::description("If true the material is thin-walled. Otherwise the material is a volume boundary. The doubleSided property has no effect on volume boundaries. Note, the thickness parameters are ignored since ray-tracing is used to compute the travelled distance within the volume.")
507
+ ]],
508
+ uniform float attenuation_distance = 0.0
509
+ [[
510
+ anno::soft_range(0.0, ::limits::FLOAT_MAX),
511
+ anno::in_group("Volume"),
512
+ anno::display_name("Attenuation Distance"),
513
+ anno::description("Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space. A value 0.0 disables it")
514
+ ]],
515
+ uniform color attenuation_color = color(1.0)
516
+ [[
517
+ anno::in_group("Volume"),
518
+ anno::display_name("Attenuation Color"),
519
+ anno::description("The color that white light turns into due to absorption when reaching the attenuation distance.")
520
+ ]],
521
+
522
+ // ambient occlusion
523
+ gltf_texture_lookup_value occlusion_texture = gltf_texture_lookup()
524
+ [[
525
+ anno::in_group("Occlusion"),
526
+ anno::display_name("Occlusion Texture"),
527
+ anno::description("The occlusion map texture. Influenced by the 'Occlusion Strength'.")
528
+ ]],
529
+ uniform float occlusion_strength = 1.0
530
+ [[
531
+ anno::hard_range(0.0, 1.0),
532
+ anno::in_group("Occlusion"),
533
+ anno::display_name("Occlusion Strength"),
534
+ anno::description("A scalar multiplier controlling the amount of occlusion applied. Multiplied to the 'Occlusion Texture'.")
535
+ ]],
536
+
537
+ // alpha
538
+ uniform gltf_alpha_mode alpha_mode = opaque
539
+ [[
540
+ anno::in_group("Opacity"),
541
+ anno::display_name("Alpha Mode"),
542
+ anno::description("Select how to interpret the alpha value.")
543
+ ]],
544
+ uniform float base_alpha = 1.0
545
+ [[
546
+ anno::hard_range(0.0, 1.0),
547
+ anno::in_group("Opacity"),
548
+ anno::display_name("Base Alpha"),
549
+ anno::description("Select between transparent (0.0) and opaque (1.0). Multiplied to the base color texture alpha channel if available."),
550
+ anno::enable_if("alpha_mode!=opaque")
551
+ ]],
552
+ // alpha for gltf_alpha_mode::mask
553
+ uniform float alpha_cutoff = 0.5
554
+ [[
555
+ anno::hard_range(0.0, 1.0),
556
+ anno::in_group("Opacity"),
557
+ anno::display_name("Alpha Cutoff"),
558
+ anno::description("Threshold to decide between fully transparent and fully opaque when alpha mode is 'mask'."),
559
+ anno::enable_if("alpha_mode==mask")
560
+ ]],
561
+
562
+ uniform string vertex_color_name = string("displayColor")
563
+ [[
564
+ anno::in_group("Primvar"),
565
+ anno::display_name("Vertex Color Name"),
566
+ anno::description("Name of the vertex color primvar usually COLOR_0(gltf), or displayColor(usd)")
567
+ ]],
568
+
569
+ uniform bool use_vertex_color_alpha = false
570
+ [[
571
+ anno::in_group("Primvar"),
572
+ anno::display_name("Use Opacity Channel From Vertex Color"),
573
+ anno::description("Multipy the Alpha or .w channel from the vertex color with the base alpha value.")
574
+ ]],
575
+
576
+ uniform string vertex_opacity_name = string("displayOpacity")
577
+ [[
578
+ anno::in_group("Primvar"),
579
+ anno::display_name("Vertex Opacity Name"),
580
+ anno::description("Name of the vertex opacity primvar usually the fourth component of COLOR_0(gltf), or displayOpacity(usd)")
581
+ ]]
582
+
583
+ ) [[
584
+ anno::author("NVIDIA Corporation"),
585
+ anno::display_name("GLTF Material - Metallic-Roughness"),
586
+ anno::description("Metallic-Roughness Material that takes the GLTF PBR model and KHR extension parameters as input.")
587
+ ]] = let {
588
+
589
+ // handling GLTF parameters
590
+ // ------------------------------------------------------------------------
591
+
592
+ float4 base_float4 = gltf_prepare_tex_float4(base_color_texture) * ::scene::data_lookup_float4(vertex_color_name, float4(1.0)); // apply vertex color
593
+ color base_color = base_color_factor * color(base_float4.x, base_float4.y, base_float4.z);
594
+
595
+ float alpha = base_alpha * (use_vertex_color_alpha == 1 ? base_float4.w : 1.0) * ((vertex_color_name != vertex_opacity_name) ? ::scene::data_lookup_float(vertex_opacity_name, float(1.0)) : 1.0);
596
+
597
+ float3 metallic_roughness = gltf_prepare_tex_float3(metallic_roughness_texture);
598
+ float metallic = metallic_factor * metallic_roughness.z;
599
+ float roughness = roughness_factor * metallic_roughness.y;
600
+
601
+ float3 normal = gltf_prepare_normal(normal_texture);
602
+ float occlusion = gltf_prepare_occlusion(occlusion_texture, occlusion_strength);
603
+ color emissive_color = gltf_perpare_emission(emissive_texture, emissive_factor * math::max(0.0f, emissive_strength));
604
+
605
+ // KHR_materials_specular
606
+ // ------------------------------------------------------------------------
607
+ color specular_color = color(gltf_prepare_tex_float3(specular_color_texture)) * specular_color_factor;
608
+ float specular = gltf_prepare_tex_float4(specular_texture).w * specular_factor;
609
+
610
+ // KHR_materials_transmission
611
+ // ------------------------------------------------------------------------
612
+ float transmission = gltf_prepare_tex_float4(transmission_texture).x * transmission_factor;
613
+
614
+ // KHR_materials_sheen
615
+ // ------------------------------------------------------------------------
616
+ color sheen_color = color(gltf_prepare_tex_float3(sheen_color_texture)) * sheen_color_factor;
617
+ float sheen_roughness = gltf_prepare_tex_float4(sheen_roughness_texture).w * sheen_roughness_factor;
618
+
619
+ // KHR_materials_clearcoat
620
+ // ------------------------------------------------------------------------
621
+ float clearcoat_blend = gltf_prepare_tex_float3(clearcoat_texture).x * clearcoat_factor;
622
+ float clearcoat_roughness = gltf_prepare_tex_float3(clearcoat_roughness_texture).y * clearcoat_roughness_factor;
623
+ float clearcoat_roughness2 = clearcoat_roughness * clearcoat_roughness;
624
+ float3 clearcoat_normal = gltf_prepare_normal(clearcoat_normal_texture);
625
+ float grazing_refl_coat = math::max((1.0 - clearcoat_roughness), 0.0);
626
+
627
+ // metallic roughness model
628
+ // ------------------------------------------------------------------------
629
+
630
+ // compute final roughness by squaring the "roughness" parameter
631
+ float roughness2 = roughness * roughness;
632
+
633
+ // reduce the reflectivity at grazing angles to avoid "dark edges"
634
+ // for high roughness due to the layering
635
+ float grazing_refl = math::max((1.0 - roughness), 0.0);
636
+
637
+ // fresnel term based on ior
638
+ float f0 = math::pow((ior - 1.0)/(ior + 1.0), 2.0);
639
+
640
+ // for the dielectric component we layer the glossy component on top of the diffuse one,
641
+ // the glossy layer has no color tint
642
+ bsdf dielectric_component = df::color_custom_curve_layer(
643
+ weight: color(1.0), // roughness is used to weight between diffuse and glossy
644
+ normal_reflectivity: math::min(f0 * specular_color, color(1.0)) * specular,
645
+ grazing_reflectivity: color(grazing_refl * specular),
646
+ layer: df::microfacet_ggx_vcavities_bsdf(roughness_u: roughness2),
647
+ base: df::weighted_layer(
648
+ weight: transmission,
649
+ base: df::diffuse_reflection_bsdf(tint: base_color * occlusion),
650
+ layer: df::microfacet_ggx_vcavities_bsdf(
651
+ roughness_u: roughness2,
652
+ tint: base_color * occlusion,
653
+ mode: df::scatter_transmit)),
654
+ normal: normal
655
+ );
656
+
657
+ // the metallic component doesn't have a diffuse component,
658
+ // its only glossy base_color is applied to tint it
659
+ bsdf metallic_component = df::microfacet_ggx_vcavities_bsdf(
660
+ tint: base_color * occlusion,
661
+ roughness_u: roughness2);
662
+
663
+ // apply sheen to the dielectic component
664
+ // add the sheen_color as weight in an outer layer to be able to blend and disable on default
665
+ // otherwise, sheen would be applied and tinted black
666
+ bsdf dielectric_sheen_component = df::color_weighted_layer(
667
+ weight: sheen_color,
668
+ layer: df::sheen_bsdf(
669
+ roughness: sheen_roughness * sheen_roughness,
670
+ tint: color(1.0),
671
+ multiscatter_tint: color(1.0),
672
+ multiscatter: dielectric_component
673
+ ),
674
+ base: dielectric_component);
675
+
676
+ // final BSDF is a linear blend between dielectric and metallic component
677
+ bsdf dielectric_metal_mix = df::weighted_layer(
678
+ weight: metallic,
679
+ base: dielectric_sheen_component,
680
+ layer: metallic_component,
681
+ normal: normal);
682
+
683
+ bsdf clearcoated = df::custom_curve_layer(
684
+ weight: clearcoat_blend,
685
+ normal_reflectivity: 0.04,
686
+ grazing_reflectivity: grazing_refl_coat,
687
+ layer: df::microfacet_ggx_vcavities_bsdf(
688
+ mode: df::scatter_reflect,
689
+ roughness_u: clearcoat_roughness2,
690
+ tint: color(1.0)),
691
+ base: df::weighted_layer(
692
+ weight: 1.0,
693
+ layer: dielectric_metal_mix,
694
+ normal: normal),
695
+ normal: clearcoat_normal);
696
+
697
+ } in material(
698
+ thin_walled: thin_walled,
699
+ surface: material_surface(
700
+ scattering: clearcoated,
701
+ emission: material_emission (
702
+ emission: df::diffuse_edf(),
703
+ intensity: emissive_color * ::math::PI
704
+ )
705
+ ),
706
+ volume: material_volume(
707
+ absorption_coefficient: thin_walled ? color(0.0) : (attenuation_distance == 0) ? color(0.0) : -math::log(attenuation_color) / attenuation_distance
708
+ ),
709
+ ior: color(ior),
710
+ geometry: material_geometry(
711
+ cutout_opacity: compute_opacity(alpha_mode, alpha, alpha_cutoff)
712
+ )
713
+ );
714
+
715
+
716
+ export material gltf_material_khr_specular_glossiness(
717
+ // diffuse color
718
+ uniform color diffuse_factor = color(1.0)
719
+ [[
720
+ anno::in_group("PBR Specular Glossiness"),
721
+ anno::display_name("Diffuse Factor"),
722
+ anno::description("The diffuse color of the material. Multiplied to the 'Diffuse Texture' if available.")
723
+ ]],
724
+ gltf_texture_lookup_value diffuse_texture = gltf_texture_lookup()
725
+ [[
726
+ anno::in_group("PBR Specular Glossiness"),
727
+ anno::display_name("Diffuse Texture"),
728
+ anno::description("The diffuse color of the material. Influenced by the 'Diffuse Factor'.")
729
+ ]],
730
+
731
+ // specular glossiness
732
+ uniform color specular_factor = 1.0
733
+ [[
734
+ anno::in_group("PBR Specular Glossiness"),
735
+ anno::display_name("Specular Factor"),
736
+ anno::description("The specular color of the material. Multiplied to the rgb values of the 'Specular/Glossy Texture' if available.")
737
+ ]],
738
+ uniform float glossiness_factor = 1.0
739
+ [[
740
+ anno::hard_range(0.0, 1.0),
741
+ anno::in_group("PBR Specular Glossiness"),
742
+ anno::display_name("Glossiness Factor"),
743
+ anno::description("The glossiness of the material. Select between diffuse (0.0) and nearly specular (1.0). Multiplied to the alpha value of the 'Specular/Glossy Texture' if available.")
744
+ ]],
745
+ gltf_texture_lookup_value specular_glossiness_texture = gltf_texture_lookup()
746
+ [[
747
+ anno::in_group("PBR Specular Glossiness"),
748
+ anno::display_name("Specular/Glossy Texture"),
749
+ anno::description("The specular-glossiness texture. Influenced by the 'Specular Factor' and 'Glossiness Factor'.")
750
+ ]],
751
+
752
+ // normal map
753
+ gltf_normal_texture_lookup_value normal_texture = gltf_normal_texture_lookup()
754
+ [[
755
+ anno::in_group("Normal Mapping"),
756
+ anno::display_name("Normal Texture"),
757
+ anno::description("Base layer normal map.")
758
+ ]],
759
+
760
+ // emission
761
+ uniform color emissive_factor = color(0.0)
762
+ [[
763
+ anno::in_group("Emission"),
764
+ anno::display_name("Emissive Factor"),
765
+ anno::description("The emissive color of the material. Multiplied to the 'Emissive Texture' if available.")
766
+ ]],
767
+ gltf_texture_lookup_value emissive_texture = gltf_texture_lookup()
768
+ [[
769
+ anno::in_group("Emission"),
770
+ anno::display_name("Emissive Texture"),
771
+ anno::description("The emissive map texture. Influenced by the 'Emissive Factor'."),
772
+ anno::enable_if("::math::average(emissive_factor)>0.0")
773
+ ]],
774
+ // KHR_materials_emissive_strength
775
+ uniform float emissive_strength = 1.0
776
+ [[
777
+ anno::soft_range(0.0, 10000),
778
+ anno::in_group("Emission"),
779
+ anno::display_name("Emissive Strength"),
780
+ anno::description("The maximum strength of the emissive texture. Multiplied to the 'Emissive Factor'."),
781
+ anno::enable_if("::math::average(emissive_factor)>0.0")
782
+ ]],
783
+
784
+ // ambient occlusion
785
+ gltf_texture_lookup_value occlusion_texture = gltf_texture_lookup()
786
+ [[
787
+ anno::in_group("Occlusion"),
788
+ anno::display_name("Occlusion Texture"),
789
+ anno::description("The occlusion map texture. Influenced by the 'Occlusion Strength'.")
790
+ ]],
791
+ uniform float occlusion_strength = 1.0
792
+ [[
793
+ anno::hard_range(0.0, 1.0),
794
+ anno::in_group("Occlusion"),
795
+ anno::display_name("Occlusion Strength"),
796
+ anno::description("A scalar multiplier controlling the amount of occlusion applied. Multiplied to the 'Occlusion Texture'.")
797
+ ]],
798
+
799
+ // alpha
800
+ uniform gltf_alpha_mode alpha_mode = opaque
801
+ [[
802
+ anno::in_group("Opacity"),
803
+ anno::display_name("Alpha Mode"),
804
+ anno::description("Select how to interpret the alpha value.")
805
+ ]],
806
+ uniform float base_alpha = 1.0
807
+ [[
808
+ anno::hard_range(0.0, 1.0),
809
+ anno::in_group("Opacity"),
810
+ anno::display_name("Base Alpha"),
811
+ anno::description("Select between transparent (0.0) and opaque (1.0). Multiplied to the base color texture alpha channel if available."),
812
+ anno::enable_if("alpha_mode!=opaque")
813
+ ]],
814
+ // alpha for gltf_alpha_mode::mask
815
+
816
+ uniform float alpha_cutoff = 0.5
817
+ [[
818
+ anno::hard_range(0.0, 1.0),
819
+ anno::in_group("Opacity"),
820
+ anno::display_name("Alpha Cutoff"),
821
+ anno::description("Threshold to decide between fully transparent and fully opaque when alpha mode is 'mask'."),
822
+ anno::enable_if("alpha_mode==mask")
823
+ ]],
824
+
825
+ uniform string vertex_color_name_spec = string("displayColor")
826
+ [[
827
+ anno::in_group("Primvar"),
828
+ anno::display_name("Vertex Color Name"),
829
+ anno::description("Name of the vertex color primvar usually COLOR_0 'gltf', or displayColor 'usd'.")
830
+ ]],
831
+
832
+ uniform bool use_vertex_color_alpha_spec = false
833
+ [[
834
+ anno::in_group("Primvar"),
835
+ anno::display_name("Use Opacity Channel From Vertex Color"),
836
+ anno::description("Multipy the Alpha or .w channel from the vertex color with the base alpha value.")
837
+ ]],
838
+
839
+ uniform string vertex_opacity_name_spec = string("displayOpacity")
840
+ [[
841
+ anno::in_group("Primvar"),
842
+ anno::display_name("Vertex Opacity Name"),
843
+ anno::description("Name of the vertex color primvar usually the .w component of COLOR_0 'gltf', or displayOpacity 'usd'.")
844
+ ]]
845
+
846
+ ) [[
847
+ anno::author("NVIDIA Corporation"),
848
+ anno::display_name("GLTF Material - Specular-Glossiness"),
849
+ anno::description("Specular-Glossiness Material that takes the GLTF KHR extension parameters as input.")
850
+ ]] = let {
851
+
852
+ // handling GLTF parameters
853
+ // ------------------------------------------------------------------------
854
+ float4 diffuse_float4 = gltf_prepare_tex_float4(diffuse_texture) * ::scene::data_lookup_float4(vertex_color_name_spec, float4(1.0)); // apply vertex color
855
+ color diffuse = diffuse_factor * color(diffuse_float4.x, diffuse_float4.y, diffuse_float4.z);
856
+
857
+ float alpha = base_alpha * (use_vertex_color_alpha_spec == 1 ? diffuse_float4.w : 1.0) * ((vertex_color_name_spec != vertex_opacity_name_spec) ? ::scene::data_lookup_float(vertex_opacity_name_spec, float(1.0)) : 1.0);
858
+ //float alpha = base_alpha;
859
+ float4 specular_glossiness = gltf_prepare_tex_float4(specular_glossiness_texture);
860
+ color specular = specular_factor * color(specular_glossiness.x, specular_glossiness.y, specular_glossiness.z);
861
+ float glossiness = glossiness_factor * specular_glossiness.w;
862
+
863
+ float3 normal = gltf_prepare_normal(normal_texture);
864
+ float occlusion = gltf_prepare_occlusion(occlusion_texture, occlusion_strength);
865
+ color emissive_color = gltf_perpare_emission(emissive_texture, emissive_factor * math::max(0.0f, emissive_strength));
866
+
867
+ // specular glossiness model
868
+ // ------------------------------------------------------------------------
869
+
870
+ //color c_diff = diffuse * (1.0 - math::maxvalue(specular));
871
+ float F_0 = math::max_value(specular);
872
+ color F_0_tint = F_0==0.0? color(0.0) : (specular/F_0);
873
+
874
+ float a = (1.0 - glossiness) * (1.0 - glossiness);
875
+
876
+ // diffuse BRDF
877
+ bsdf diffuse_brdf = df::diffuse_reflection_bsdf(
878
+ tint: diffuse * occlusion,
879
+ roughness: 0.0);
880
+
881
+ // specular BRDF
882
+ bsdf specular_brdf = df::microfacet_ggx_smith_bsdf(
883
+ tint: color(occlusion),
884
+ roughness_u: a,
885
+ roughness_v: a,
886
+ tangent_u: state::texture_tangent_u(0));
887
+ bsdf tinted_specular = df::directional_factor(normal_tint: F_0_tint, grazing_tint: color(1.0), exponent: 5.0, base: specular_brdf);
888
+ //- Custom curve for specular/diffuse angular mix
889
+ bsdf diffuse_specular_mix = df::custom_curve_layer(
890
+ normal_reflectivity: F_0,
891
+ grazing_reflectivity: 1.0,
892
+ exponent: 5.0,
893
+ weight: 1.0,
894
+ layer: tinted_specular,
895
+ base: diffuse_brdf,
896
+ normal: normal);
897
+
898
+ } in material(
899
+ surface: material_surface(
900
+ scattering: diffuse_specular_mix,
901
+ emission: material_emission (
902
+ emission: df::diffuse_edf(),
903
+ intensity: emissive_color * ::math::PI
904
+ )
905
+ ),
906
+ geometry: material_geometry(
907
+ normal: normal,
908
+ cutout_opacity: compute_opacity(alpha_mode, alpha, alpha_cutoff)
909
+ )
910
+ );
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/SubUSDs/textures/color_204204204.hdr ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #?RADIANCE
2
+ FORMAT=32-bit_rle_rgbe
3
+
4
+ -Y 4 +X 4
5
+ ��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀��̀
saved/assets/scene_usds/scientific_experiments/task_01_pour_flask_to_cylinder/public_validation/scene.usda ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #usda 1.0
2
+ (
3
+ customLayerData = {
4
+ dictionary omni_layer = {
5
+ dictionary locked = {
6
+ }
7
+ dictionary muteness = {
8
+ }
9
+ }
10
+ dictionary renderSettings = {
11
+ float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0)
12
+ float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75)
13
+ float3 "rtx:index:backgroundColor" = (0, 0, 0)
14
+ float3 "rtx:index:regionOfInterestMax" = (0, 0, 0)
15
+ float3 "rtx:index:regionOfInterestMin" = (0, 0, 0)
16
+ float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0)
17
+ float3 "rtx:post:colorcorr:contrast" = (1, 1, 1)
18
+ float3 "rtx:post:colorcorr:gain" = (1, 1, 1)
19
+ float3 "rtx:post:colorcorr:gamma" = (1, 1, 1)
20
+ float3 "rtx:post:colorcorr:offset" = (0, 0, 0)
21
+ float3 "rtx:post:colorcorr:saturation" = (1, 1, 1)
22
+ float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0)
23
+ float3 "rtx:post:colorgrad:contrast" = (1, 1, 1)
24
+ float3 "rtx:post:colorgrad:gain" = (1, 1, 1)
25
+ float3 "rtx:post:colorgrad:gamma" = (1, 1, 1)
26
+ float3 "rtx:post:colorgrad:lift" = (0, 0, 0)
27
+ float3 "rtx:post:colorgrad:multiply" = (1, 1, 1)
28
+ float3 "rtx:post:colorgrad:offset" = (0, 0, 0)
29
+ float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1)
30
+ float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50)
31
+ float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500)
32
+ float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10)
33
+ float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2)
34
+ float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10)
35
+ float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75)
36
+ float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50)
37
+ float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1)
38
+ float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32)
39
+ float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9)
40
+ float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5)
41
+ float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1)
42
+ int "rtx:translucency:maxRefractionBounces" = 16
43
+ double "rtx:translucency:worldEps" = 0.005
44
+ }
45
+ }
46
+ defaultPrim = "World"
47
+ endTimeCode = 1000000
48
+ metersPerUnit = 1
49
+ startTimeCode = 0
50
+ timeCodesPerSecond = 60
51
+ upAxis = "Z"
52
+ )
53
+
54
+ over "Render" (
55
+ hide_in_stage_window = true
56
+ )
57
+ {
58
+ }
59
+
60
+ def Xform "World"
61
+ {
62
+ def "_scene" (
63
+ prepend payload = @scene.usd@
64
+ )
65
+ {
66
+ float3 xformOp:rotateXYZ = (0, 0, 0)
67
+ float3 xformOp:scale = (1, 1, 1)
68
+ double3 xformOp:translate = (0, 0, 0)
69
+ uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"]
70
+ }
71
+ }
72
+
73
+ def Xform "Environment"
74
+ {
75
+ double3 xformOp:rotateXYZ = (0, 0, 0)
76
+ double3 xformOp:scale = (1, 1, 1)
77
+ double3 xformOp:translate = (0, 0, 0)
78
+ uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"]
79
+ }
80
+
saved/tasks/scientific_experiments/task_01_pour_flask_to_cylinder/validation_mixed_1/000/meta_info.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c1b076bf353abd13022f1f31dd398b77c09f8abae13e369e8852df9857a45f9
3
+ size 21801